/** Build the 'Page' toolbar
*/
- function make_toolbar()
+ function make_toolbar(&$caller)
{
global $globals;
$props = $this->props;
$topbar = array ();
+ $from = htmlentities($caller->script_uri());
if ($props['PID']) {
$hp = $this->barrel->getPID('');
array_push($topbar, array( __("browse files"), "files?dir={$props['PID']}" ));
array_push($topbar, array( __("page properties"), "pages?dir={$props['PID']}" ));
array_push($topbar, array( __("view page"), "../". $this->getLocation()));
- array_push($topbar, array(__("add a page"), "pages?action=edit&parent=".$props['PID']) );
+ array_push($topbar, array(__("add a page"), "pages?action=edit&parent=".$props['PID']."&from=$from") );
if ($this->barrel->flags->hasFlag("plug")) {
array_push($topbar, array( __("plugins"), "plugins?plug_page={$props['PID']}" ) );
}
}
- /** Write the page's properties to database
+ /** Write the page's properties to database and returns the PID of that page.
*
* @param $homepage
* @param $caller
}
}
}
-
// check that the location is valid
if ($homepage)
// recompile tree
$this->barrel->compileTree();
- $this->barrel->readTree();
- }
+ $this->barrel->readTree();
+
+ return $props['PID'];
+ }
+
}
?>