예제 #1
0
 /**
  * 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);
 }