/** * 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 FOLDER $obj * @access private */ protected function _draw_box($obj) { $t = $obj->title_formatter(); $t->max_visible_output_chars = 0; echo '<h3>' . $obj->title_as_link($t) . '</h3>'; $entry_query = $obj->entry_query(); $entry_query->set_filter(Visible); $size = $entry_query->size(); if ($size) { $entry_query->set_limits(0, 10); /** @var ENTRY[] $entries */ $entries = $entry_query->objects(); $count = sizeof($entries); if ($count) { ?> <p> <?php echo $size; ?> Articles </p> <ul class="detail"> <?php foreach ($entries as $entry) { $t = $entry->title_formatter(); $f = $entry->time_created->formatter(); $f->type = Date_time_format_short_date; $f->show_local_time = false; $t->title = $entry->time_created->format($f); ?> <li> <?php echo $entry->title_as_link($t); ?> </li> <?php } if ($size > 10) { echo "<li>[<a href=\"view_folder.php?id={$obj->id}\">More</a>]</li>\n"; } ?> </ul> <?php } } }