if ($num > 0)
{
$caller->info(__("Not deleting page, it has child pages!"));
- return;
+ return false;
}
$rcs = $caller->getRcs();
system("rm -rf ". escapeshellarg($rcs->spoolPath($dir)));
$barrel->compileTree();
$barrel->readTree();
+ return true;
}
/** 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
if ($props['PID'])
{
$cache = $globals->plugins->readCache($this->barrel->pluginsCacheFile, $this->barrel->alias);
- $plugs_active = $globals->plugins->cacheGetActive($cache, $this->barrel->alias, $props['PID']);
+ $plugs_active = $globals->plugins->cachedActive($cache, $this->barrel->alias, $props['PID']);
foreach($plugs_active as $plugentry)
{
$plug_h = $globals->plugins->load($plugentry);
}
}
}
-
// check that the location is valid
if ($homepage)
// recompile tree
$this->barrel->compileTree();
- $this->barrel->readTree();
- }
+ $this->barrel->readTree();
+
+ return $props['PID'];
+ }
+
}
?>