page =& $page; $this->props = array( 'file' => $file ); /* if (is_array($props)) { foreach (array_keys($props) as $key) { $this->props[$key] = $props[$key]; } }*/ } /** Delete a file (not implemented) * * @param $barrel * @param $dir */ function delete(&$barrel, $dir) { global $globals; } /** Return the list of action applicable to the file * * @param $canedit */ function make_actions($canedit) { global $globals; $dir = $this->page->props['PID']; $file = $this->props['file']; $rev = "files?action=revs&dir=$dir&target=$file"; $edit = "edit?dir=$dir&file=$file"; $del = "javascript:file_delete('$dir','$file');"; $rename = "javascript:file_rename('$dir','$file');"; $view = "../". $this->page->getLocation($file); $actions = array(); if ($view) array_push($actions, array(__("view"), $view, "view")); if ($edit && $canedit) array_push($actions, array(__("edit"), $edit, "edit")); if ($rev) array_push($actions, array(__("revisions"),$rev, "revisions")); if ($rename && $canedit) array_push($actions, array(__("rename"), $rename, "rename")); if ($del && $canedit) array_push($actions, array(__("delete"), $del, "delete")); return $globals->icons->get_action_icons($actions); } /** Build the 'File' toolbar * * @param $canedit */ function make_toolbar($canedit) { $dir = $this->page->props['PID']; $file = $this->props['file']; global $afile; $filebar = array (); if ($canedit) { array_push($filebar, array( __("raw editor"), ($afile == "edit") ? "" : "edit?dir=$dir&file=$file")); array_push($filebar, array( __("HTML editor"), ($afile == "compose") ? "" : "compose?dir=$dir&file=$file")); } array_push($filebar, array( __("file revisions"), "files?action=revs&dir=$dir&target=$file")); return $filebar; } } ?>