/** * SetVars * */ public function SetVars() { global $dataDir, $config; if (!parent::SetVars()) { return false; } $this->permission_edit = admin_tools::CanEdit($this->gp_index); $this->permission_menu = admin_tools::HasPermission('Admin_Menu'); $this->draft_file = dirname($this->file) . '/draft.php'; //admin actions if ($this->permission_menu) { $this->cmds['renameform'] = 'return'; $this->cmds['togglevisibility'] = ''; } if ($this->permission_edit) { $this->cmds['rawcontent'] = 'return'; $this->cmds['managesections'] = 'newsectioncontent'; $this->cmds['newsectioncontent'] = 'return'; $this->cmds['savesections'] = 'return'; $this->cmds['viewrevision'] = 'return'; $this->cmds['userevision'] = ''; $this->cmds['viewhistory'] = 'return'; $this->cmds['viewcurrent'] = 'return'; $this->cmds['deleterevision'] = 'viewhistory'; $this->cmds['publishdraft'] = ''; $this->cmds['discarddraft'] = ''; } if (!gpFiles::Exists($this->draft_file)) { return true; } $this->draft_exists = true; return true; }
/** * SetVars * */ function SetVars() { global $dataDir, $config; if (!parent::SetVars()) { return false; } $this->draft_file = dirname($this->file) . '/draft.php'; if (!gpFiles::Exists($this->draft_file)) { return true; } $this->draft_exists = true; return true; }