X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2FBarrel%2FPage.php;h=118effe38cc538e34a8f3cd07fa70ac6d67b767a;hb=8edec79dfecfe7ff0c9edea934487eced50d88e2;hp=d680bc456cab05b7fd3128d109f4c35ec048ff4c;hpb=d2cf8e2c70cdbd10213a5c123c278a7257d8e210;p=diogenes.git diff --git a/include/Barrel/Page.php b/include/Barrel/Page.php index d680bc4..118effe 100644 --- a/include/Barrel/Page.php +++ b/include/Barrel/Page.php @@ -87,7 +87,7 @@ class Diogenes_Barrel_Page if ($num > 0) { $caller->info(__("Not deleting page, it has child pages!")); - return; + return false; } $rcs = $caller->getRcs(); @@ -97,6 +97,7 @@ class Diogenes_Barrel_Page system("rm -rf ". escapeshellarg($rcs->spoolPath($dir))); $barrel->compileTree(); $barrel->readTree(); + return true; } @@ -158,12 +159,13 @@ class Diogenes_Barrel_Page /** 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(''); @@ -173,7 +175,7 @@ class Diogenes_Barrel_Page 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']}" ) ); } @@ -201,7 +203,7 @@ class Diogenes_Barrel_Page } - /** 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 @@ -232,7 +234,6 @@ class Diogenes_Barrel_Page } } } - // check that the location is valid if ($homepage) @@ -323,8 +324,11 @@ class Diogenes_Barrel_Page // recompile tree $this->barrel->compileTree(); - $this->barrel->readTree(); - } + $this->barrel->readTree(); + + return $props['PID']; + } + } ?>