/** Add buttons that create items in the folder. * @param FOLDER &$folder * @access private */ function _add_creators(&$folder) { parent::_add_creators($folder); $cmd = $this->make_command(); $cmd->id = 'new_recipe'; $cmd->title = 'New recipe'; $cmd->link = "create_recipe.php?id={$folder->id}"; $cmd->icon = '{app_icons}buttons/new_recipe'; $cmd->executable = $this->login->is_allowed(Privilege_set_entry, Privilege_create, $folder); $cmd->importance = Command_importance_high; $this->append($cmd); }
/** * @param RECIPE_BOOK $folder Configure commands for this object. */ public function __construct($folder) { parent::__construct($folder); $cmd = $this->command_at('new'); $cmd->caption = 'New recipe book'; $cmd = $this->command_at('new_entry'); $cmd->caption = 'New recipe'; $cmd->icon = '{app_icons}buttons/new_recipe'; if ($folder->is_organizational()) { $cmd->link = "select_folder.php?page_name=create_recipe.php"; } else { $cmd->link = "create_recipe.php?id={$folder->id}"; } }
/** * Add commands that provide views on the folder. * @param FOLDER $folder Show commands for this folder. * @access private */ protected function _add_viewers($folder) { $cmd = $this->make_command(); $cmd->id = 'calendar'; $cmd->caption = 'Calendar'; $cmd->link = "view_calendar.php?id={$folder->id}"; $cmd->icon = '{icons}buttons/calendar'; $cmd->executable = true; $cmd->importance = Command_importance_high; $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'print_preview'; $cmd->caption = 'Print preview'; $cmd->link = "multiple_print.php?id={$folder->id}"; $entry_query = $folder->entry_query(); $entry_query->set_type('journal'); if ($entry_query->size()) { $cmd->link .= '&entry_type=journal'; } else { $cmd->link .= '&entry_type=picture'; } $cmd->icon = '{icons}buttons/print'; $cmd->executable = true; $cmd->importance = Command_importance_high; $this->append($cmd); parent::_add_viewers($folder); }
/** * @param PROJECT $folder Configure commands for this object. */ public function __construct($folder) { parent::__construct($folder); $cmd = $this->command_at('new'); $cmd->caption = 'New project'; }