当前位置: 首页>>代码示例>>PHP>>正文


PHP midcom_core_context类代码示例

本文整理汇总了PHP中midcom_core_context的典型用法代码示例。如果您正苦于以下问题:PHP midcom_core_context类的具体用法?PHP midcom_core_context怎么用?PHP midcom_core_context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了midcom_core_context类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     $this->root_topic = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC);
     $this->current_object = $this->root_topic;
     // TODO: Remove
     $this->check_style_inheritance($this->root_topic);
 }
开发者ID:nemein,项目名称:openpsa,代码行数:7,代码来源:urlparsertopic.php

示例2: send

 public function send()
 {
     if (!preg_match('|^https?://|', $this->url)) {
         if ($this->url == '' || substr($this->url, 0, 1) != "/") {
             $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
             if ($prefix == '') {
                 $prefix = midcom::get()->get_page_prefix();
             }
             $this->url = "{$prefix}{$this->url}";
             debug_add("This is a relative URL from the local site, prepending anchor prefix: {$this->url}");
         } else {
             $this->url = midcom::get()->get_host_name() . $this->url;
             debug_add("This is an absolute URL from the local host, prepending host name: {$this->url}");
         }
         $location = "Location: {$this->url}";
     } else {
         // This is an external URL
         $location = "Location: {$this->url}";
     }
     midcom::get('cache')->content->no_cache();
     midcom::get()->finish();
     debug_add("Relocating to {$location}");
     midcom::get()->header($location, $this->code);
     _midcom_stop_request();
 }
开发者ID:nemein,项目名称:openpsa,代码行数:25,代码来源:relocate.php

示例3: _handler_delete

 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_delete($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_user_do('org.openpsa.user:manage', null, 'org_openpsa_user_interface');
     $this->_group = new midcom_db_group($args[0]);
     if (array_key_exists('org_openpsa_user_deleteok', $_POST)) {
         $delete_succeeded = $this->_group->delete();
         $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
         if ($delete_succeeded) {
             // Update the index
             $indexer = midcom::get('indexer');
             $indexer->delete($this->_group->guid);
             return new midcom_response_relocate('');
         } else {
             // Failure, give a message
             midcom::get('uimessages')->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get("failed to delete group, reason") . ' ' . midcom_connection::get_error_string(), 'error');
             return new midcom_response_relocate($prefix . 'group/' . $this->_group->guid . '/');
         }
     }
     $data['view'] = midcom_helper_datamanager2_handler::get_view_controller($this, $this->_group);
     $data['group'] = $this->_group;
     org_openpsa_widgets_tree::add_head_elements();
     $this->add_breadcrumb('groups/', $this->_l10n->get('groups'));
     $this->add_breadcrumb('', sprintf($this->_l10n_midcom->get('delete %s'), $this->_group->get_label()));
     $this->bind_view_to_object($this->_group);
 }
开发者ID:nemein,项目名称:openpsa,代码行数:30,代码来源:delete.php

示例4: get_row

 public function get_row(midcom_core_dbaobject $document)
 {
     $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
     $entry = array();
     $entry['id'] = $document->id;
     $entry['index_title'] = $document->title;
     $entry['index_filesize'] = 0;
     $entry['filesize'] = '';
     $entry['mimetype'] = '';
     $icon = MIDCOM_STATIC_URL . '/stock-icons/mime/gnome-text-blank.png';
     $alt = '';
     $att = $document->load_attachment();
     if ($att) {
         $icon = midcom_helper_misc::get_mime_icon($att->mimetype);
         $alt = $att->name;
         $stats = $att->stat();
         $entry['index_filesize'] = $stats[7];
         $entry['filesize'] = midcom_helper_misc::filesize_to_string($stats[7]);
         $entry['mimetype'] = org_openpsa_documents_document_dba::get_file_type($att->mimetype);
     }
     $title = '<a class="tab_escape" href="' . $prefix . 'document/' . $document->guid . '/"><img src="' . $icon . '"';
     $title .= 'alt="' . $alt . '" style="border: 0px; height: 16px; vertical-align: middle" /> ' . $document->title . '</a>';
     $entry['title'] = $title;
     $entry['created'] = strftime('%Y-%m-%d %X', $document->metadata->created);
     $entry['index_author'] = '';
     $entry['author'] = '';
     if ($document->author) {
         $author = org_openpsa_contacts_person_dba::get_cached($document->author);
         $entry['index_author'] = $author->rname;
         $author_card = org_openpsa_widgets_contact::get($author->guid);
         $entry['author'] = $author_card->show_inline();
     }
     return $entry;
 }
开发者ID:nemein,项目名称:openpsa,代码行数:34,代码来源:view.php

示例5: _show_rss

 /**
  *
  * @param mixed $handler_id The ID of the handler.
  * @param array &$data The local request data.
  */
 public function _show_rss($handler_id, array &$data)
 {
     $qb = net_nemein_wiki_wikipage::new_query_builder();
     $qb->add_constraint('topic.component', '=', midcom_core_context::get()->get_key(MIDCOM_CONTEXT_COMPONENT));
     $qb->add_constraint('topic', 'INTREE', $this->_topic->id);
     $qb->add_order('metadata.revised', 'DESC');
     $qb->set_limit($this->_config->get('rss_count'));
     $result = $qb->execute();
     foreach ($result as $wikipage) {
         if ($wikipage->topic == $this->_topic->id) {
             $node = $data['node'];
         } else {
             $node = $data['nap']->get_node($wikipage->topic);
         }
         $item = new FeedItem();
         $item->title = $wikipage->title;
         if ($wikipage->name == 'index') {
             $item->link = "{$node[MIDCOM_NAV_FULLURL]}";
         } else {
             $item->link = "{$node[MIDCOM_NAV_FULLURL]}{$wikipage->name}/";
         }
         $item->date = $wikipage->metadata->revised;
         try {
             $author = new midcom_db_person($wikipage->metadata->revisor);
             $item->author = $author->name;
         } catch (midcom_error $e) {
             $e->log();
         }
         $parser = new net_nemein_wiki_parser($wikipage);
         $item->description = $parser->get_html();
         $data['rss_creator']->addItem($item);
     }
     $data['rss'] = $data['rss_creator']->createFeed('RSS2.0');
     echo $data['rss'];
 }
开发者ID:nemein,项目名称:openpsa,代码行数:40,代码来源:feed.php

示例6: _populate_toolbar

 private function _populate_toolbar()
 {
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n_midcom']->get('view'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png', MIDCOM_TOOLBAR_ACCESSKEY => 'v'));
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "edit/{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n_midcom']->get('edit'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ACCESSKEY => 'e', MIDCOM_TOOLBAR_ENABLED => $this->_page->can_do('midgard:update')));
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "delete/{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n_midcom']->get('delete'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png', MIDCOM_TOOLBAR_ACCESSKEY => 'd', MIDCOM_TOOLBAR_ENABLED => $this->_page->can_do('midgard:delete')));
     foreach (array_keys($this->_request_data['schemadb']) as $name) {
         if ($name == $this->_datamanager->schema->name) {
             // The page is already of this type, skip
             continue;
         }
         $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "change/{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('change to %s'), $this->_l10n->get($this->_request_data['schemadb'][$name]->description)), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_refresh.png', MIDCOM_TOOLBAR_POST => true, MIDCOM_TOOLBAR_POST_HIDDENARGS => array('change_to' => $name), MIDCOM_TOOLBAR_ENABLED => $this->_page->can_do('midgard:update')));
     }
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "whatlinks/{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('what links'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/jump-to.png'));
     if (midcom::get('auth')->user) {
         $user = midcom::get('auth')->user->get_storage();
         if ($this->_page->parameter('net.nemein.wiki:watch', $user->guid)) {
             $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "subscribe/{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('unsubscribe'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_mail.png', MIDCOM_TOOLBAR_POST => true, MIDCOM_TOOLBAR_POST_HIDDENARGS => array('unsubscribe' => 1)));
         } else {
             $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "subscribe/{$this->_page->name}/", MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('subscribe'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_mail.png', MIDCOM_TOOLBAR_POST => true, MIDCOM_TOOLBAR_POST_HIDDENARGS => array('subscribe' => 1)));
         }
     }
     if ($this->_page->can_do('midgard:update')) {
         midcom::get('head')->add_link_head(array('rel' => 'alternate', 'type' => 'application/x-wiki', 'title' => $this->_request_data['l10n_midcom']->get('edit'), 'href' => midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "edit/{$this->_page->name}/"));
     }
     if (midcom::get('componentloader')->is_installed('org.openpsa.relatedto')) {
         org_openpsa_relatedto_plugin::add_button($this->_view_toolbar, $this->_page->guid);
     }
     $this->bind_view_to_object($this->_page, $this->_datamanager->schema->name);
 }
开发者ID:nemein,项目名称:openpsa,代码行数:29,代码来源:view.php

示例7: _get_sorted_reports

 /**
  * Sort the reports by task and day
  */
 private function _get_sorted_reports($hours_mc)
 {
     $reports = array();
     $hours = $hours_mc->list_keys();
     $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
     foreach ($hours as $guid => $empty) {
         $task_id = $hours_mc->get_subkey($guid, 'task');
         try {
             $task = org_openpsa_projects_task_dba::get_cached($task_id);
         } catch (midcom_error $e) {
             // Task couldn't be loaded, probably because of ACL
             continue;
         }
         $person = $hours_mc->get_subkey($guid, 'person');
         $date = $hours_mc->get_subkey($guid, 'date');
         $date_identifier = date('Y-m-d', $date);
         $row_identifier = $task->id . '-' . $person;
         if (!isset($reports[$row_identifier])) {
             $reports[$row_identifier] = array($date_identifier => 0, 'task' => "<a href=\"{$prefix}hours/task/{$task->guid}/\">" . $task->get_label() . "</a>", 'task_index' => $task->get_label());
             try {
                 $person = org_openpsa_contacts_person_dba::get_cached($person);
                 $reports[$row_identifier]['person'] = $person->name;
             } catch (midcom_error $e) {
                 $reports[$row_identifier]['person'] = $this->_l10n->get('no person');
             }
         }
         if (!isset($reports[$row_identifier][$date_identifier])) {
             $reports[$row_identifier][$date_identifier] = 0;
         }
         $reports[$row_identifier][$date_identifier] += $hours_mc->get_subkey($guid, 'hours');
     }
     return array_values($reports);
 }
开发者ID:nemein,项目名称:openpsa,代码行数:36,代码来源:index.php

示例8: _handler_edit

 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_edit($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_valid_user();
     // Check if we get the group
     $this->_group = new org_openpsa_contacts_group_dba($args[0]);
     $this->_group->require_do('midgard:update');
     if ($this->_group->orgOpenpsaObtype < org_openpsa_contacts_group_dba::MYCONTACTS) {
         $this->_type = 'group';
     } else {
         $this->_type = 'organization';
     }
     $data['controller'] = $this->get_controller('simple', $this->_group);
     switch ($data['controller']->process_form()) {
         case 'save':
             $indexer = new org_openpsa_contacts_midcom_indexer($this->_topic);
             $indexer->index($data['controller']->datamanager);
             // *** FALL-THROUGH ***
         // *** FALL-THROUGH ***
         case 'cancel':
             $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
             return new midcom_response_relocate($prefix . "group/" . $this->_group->guid . "/");
     }
     $root_group = org_openpsa_contacts_interface::find_root_group();
     if ($this->_group->owner && $this->_group->owner != $root_group->id) {
         $data['parent_group'] = new org_openpsa_contacts_group_dba($this->_group->owner);
     } else {
         $data['parent_group'] = false;
     }
     $data['group'] =& $this->_group;
     org_openpsa_helpers::dm2_savecancel($this);
     $this->bind_view_to_object($this->_group);
     midcom::get('head')->set_pagetitle(sprintf($this->_l10n_midcom->get('edit %s'), $this->_group->official));
     org_openpsa_contacts_viewer::add_breadcrumb_path_for_group($this->_group, $this);
     $this->add_breadcrumb("", sprintf($this->_l10n_midcom->get('edit %s'), $this->_l10n->get($this->_type)));
 }
开发者ID:nemein,项目名称:openpsa,代码行数:40,代码来源:edit.php

示例9: _handler_delete

 /**
  * Handler for folder deletion.
  *
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  * @return boolean Indicating success
  */
 public function _handler_delete($handler_id, array $args, array &$data)
 {
     // Symlink support requires that we use actual URL topic object here
     $urltopics = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_URLTOPICS);
     if ($urltopic = end($urltopics)) {
         $this->_topic = $urltopic;
     }
     $this->_topic->require_do('midgard:delete');
     $this->_topic->require_do('midcom.admin.folder:topic_management');
     if (array_key_exists('f_cancel', $_REQUEST)) {
         return new midcom_response_relocate('');
     }
     if (array_key_exists('f_submit', $_REQUEST)) {
         $nav = new midcom_helper_nav();
         $upper_node = $nav->get_node($nav->get_current_upper_node());
         if ($this->_process_delete_form()) {
             return new midcom_response_relocate($upper_node[MIDCOM_NAV_FULLURL]);
         }
     }
     $this->_request_data['topic'] = $this->_topic;
     // Add the view to breadcrumb trail
     $this->add_breadcrumb('__ais/folder/delete/', $this->_l10n->get('delete folder'));
     // Hide the button in toolbar
     $this->_node_toolbar->hide_item('__ais/folder/delete/');
     // Set page title
     $data['title'] = sprintf(midcom::get('i18n')->get_string('delete folder %s', 'midcom.admin.folder'), $data['topic']->extra);
     midcom::get('head')->set_pagetitle($data['title']);
     // Set the help object in the toolbar
     $help_toolbar = midcom::get('toolbars')->get_help_toolbar();
     $help_toolbar->add_help_item('delete_folder', 'midcom.admin.folder', null, null, 1);
     // Ensure we get the correct styles
     midcom::get('style')->prepend_component_styledir('midcom.admin.folder');
     // Add style sheet
     $this->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.admin.folder/folder.css');
 }
开发者ID:nemein,项目名称:openpsa,代码行数:43,代码来源:delete.php

示例10: _populate_toolbar

    /**
     * Populate the toolbar
     *
     * @param String $today_path    Path to the today's calendar
     */
    private function _populate_toolbar($path = null)
    {
        // 'New event' should always be in toolbar
        $nap = new midcom_helper_nav();
        $this_node = $nap->get_node($nap->get_current_node());
        if ($this->_root_event->can_do('midgard:create')) {
            $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => '#', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create event'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_new-event.png', MIDCOM_TOOLBAR_OPTIONS => array('rel' => 'directlink', 'onclick' => org_openpsa_calendar_interface::calendar_newevent_js($this_node))));
        }
        if (method_exists($this->_calendar, 'get_' . $path . '_start')) {
            $previous = date('Y-m-d', call_user_func(array($this->_calendar, 'get_' . $path . '_start')) - 100);
            $next = date('Y-m-d', call_user_func(array($this->_calendar, 'get_' . $path . '_end')) + 100);
            $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $path . '/' . $previous . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('previous'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/up.png'));
            $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $path . '/' . $next . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('next'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/down.png'));
        }
        if ($this->_topic->can_do('midgard:update') && $this->_topic->can_do('midcom:component_config')) {
            $this->_node_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'config/', MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('component configuration helptext'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_folder-properties.png'));
        }
        midcom_helper_datamanager2_widget_jsdate::add_head_elements();
        midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/org.openpsa.calendar/navigation.js");
        $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
        $default_date = date('Y-m-d', $this->_selected_time);
        midcom::get('head')->add_jscript('
var org_openpsa_calendar_default_date = "' . $default_date . '",
org_openpsa_calendar_prefix = "' . $prefix . $path . '";
        ');
        $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => '#', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('go to'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_jump-to.png', MIDCOM_TOOLBAR_OPTIONS => array('rel' => 'directlink', 'id' => 'date-navigation')));
        $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "{$path}/" . $this->_get_datestring(time()) . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('today'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/web-calendar.png'));
        $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "filters/?org_openpsa_calendar_returnurl=" . midcom_connection::get_url('uri'), MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('choose calendars'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/preferences-desktop.png'));
    }
开发者ID:nemein,项目名称:openpsa,代码行数:34,代码来源:view.php

示例11: __construct

 /**
  * Constructs a session object.
  *
  * The constructor has three semantics:
  *
  * The default constructor will create a sessioning object within the domain
  * of the current context's component. This will be sufficient for almost all
  * actual uses of the sessions.
  *
  * If passed an integer argument, it will use the context indicated by this
  * parameter as a default domain.
  *
  * Finally, if passed a string argument, this value is used as a domain. This
  * is useful for components that need sessioning while under <i>dynamic_load</i>
  * conditions or while used as a <i>library</i>.
  *
  * @param mixed $context    Either null or a context ID (uses the context's component) or an explicit domain.
  */
 public function __construct($context = null)
 {
     if (is_null($context) || is_numeric($context) || is_int($context)) {
         $this->_domain = midcom_core_context::get($context)->get_key(MIDCOM_CONTEXT_COMPONENT);
     } else {
         $this->_domain = $context;
     }
     $this->_sessioning = midcom::get("session");
 }
开发者ID:nemein,项目名称:openpsa,代码行数:27,代码来源:session.php

示例12: navigation

 public function navigation()
 {
     $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
     $libs = midcom_admin_libconfig_plugin::get_libraries();
     echo '<ul class="midgard_admin_asgard_navigation">';
     foreach ($libs as $name => $manifest) {
         $label = midcom::get('i18n')->get_string($name, $name);
         echo "            <li class=\"status\"><a href=\"{$prefix}__mfa/asgard_midcom.admin.libconfig/view/{$name}/\">{$label}</a></li>\n";
     }
     echo "</ul>";
 }
开发者ID:nemein,项目名称:openpsa,代码行数:11,代码来源:plugin.php

示例13: midgard_admin_asgard_trash_type_show

function midgard_admin_asgard_trash_type_show($object, $indent = 0, $prefix = '', $enable_undelete = true)
{
    static $persons = array();
    static $shown = array();
    static $url_prefix = '';
    if (!$url_prefix) {
        $url_prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
    }
    if (isset($shown[$object->guid])) {
        return;
    }
    if (!isset($persons[$object->metadata->revisor])) {
        $persons[$object->metadata->revisor] = midcom::get('auth')->get_user($object->metadata->revisor);
    }
    $reflector = midcom_helper_reflector_tree::get($object);
    $icon = $reflector->get_object_icon($object);
    echo "{$prefix}<tr>\n";
    $disabled = '';
    if (!$enable_undelete) {
        $disabled = ' disabled="disabled"';
    }
    $object_label = $reflector->get_object_label($object);
    if (empty($object_label)) {
        $object_label = $object->guid;
    }
    echo "{$prefix}    <td class=\"checkbox\"><input type=\"checkbox\" name=\"undelete[]\"{$disabled} value=\"{$object->guid}\" id=\"guid_{$object->guid}\" /></td>\n";
    echo "{$prefix}    <td class=\"label\" style=\"padding-left: {$indent}px\"><label for=\"guid_{$object->guid}\">{$icon}" . $object_label . "</label></td>\n";
    echo "{$prefix}    <td class=\"nowrap\">" . strftime('%x %X', strtotime($object->metadata->revised)) . "</td>\n";
    if (isset($persons[$object->metadata->revisor]->guid)) {
        echo "{$prefix}    <td><a href=\"{$url_prefix}__mfa/asgard/object/view/{$persons[$object->metadata->revisor]->guid}/\">{$persons[$object->metadata->revisor]->name}</a></td>\n";
    } else {
        echo "{$prefix}    <td>&nbsp;</td>\n";
    }
    echo "{$prefix}    <td>" . midcom_helper_misc::filesize_to_string($object->metadata->size) . "</td>\n";
    echo "{$prefix}</tr>\n";
    $child_types = midcom_helper_reflector_tree::get_child_objects($object, true);
    if (is_array($child_types) && count($child_types) > 0) {
        $child_indent = $indent + 20;
        echo "{$prefix}<tbody class=\"children\">\n";
        foreach ($child_types as $type => $children) {
            if (count($children) < 10 || isset($_GET['show_children'][$object->guid][$type])) {
                foreach ($children as $child) {
                    midgard_admin_asgard_trash_type_show($child, $child_indent, "{$prefix}    ", false);
                }
            } else {
                echo "{$prefix}    <tr>\n";
                echo "{$prefix}        <td class=\"label\" style=\"padding-left: {$child_indent}px\" colspan=\"5\"><a href=\"?show_children[{$object->guid}][{$type}]=1\">" . sprintf(midcom::get('i18n')->get_string('show %s %s children', 'midgard.admin.asgard'), count($children), midgard_admin_asgard_plugin::get_type_label($type)) . "</a></td>\n";
                echo "{$prefix}    </tr>\n";
            }
        }
        echo "{$prefix}</tbody>\n";
    }
    $shown[$object->guid] = true;
}
开发者ID:nemein,项目名称:openpsa,代码行数:54,代码来源:midgard_admin_asgard_trash_type.php

示例14: disable_language_select

 /**
  * If the folder already has content in it we should disable the language chooser to avoid confusion
  *
  * @return boolean
  */
 static function disable_language_select()
 {
     // We cannot use $this->_topic in a static method
     $topic = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_CONTENTTOPIC);
     $qb = midcom_db_article::new_query_builder();
     $qb->add_constraint('topic', '=', $topic->id);
     $qb->set_limit(1);
     if ($qb->count() > 0) {
         return true;
     }
     return false;
 }
开发者ID:nemein,项目名称:openpsa,代码行数:17,代码来源:viewer.php

示例15: _show_today

 /**
  *
  * @param mixed $handler_id The ID of the handler.
  * @param array &$data The local request data.
  */
 public function _show_today($handler_id, array &$data)
 {
     $siteconfig = org_openpsa_core_siteconfig::get_instance();
     $data['calendar_url'] = $siteconfig->get_node_relative_url('org.openpsa.calendar');
     $data['projects_url'] = $siteconfig->get_node_full_url('org.openpsa.projects');
     $data['projects_relative_url'] = $siteconfig->get_node_relative_url('org.openpsa.projects');
     $data['expenses_url'] = $siteconfig->get_node_full_url('org.openpsa.expenses');
     $data['wiki_url'] = $siteconfig->get_node_relative_url('net.nemein.wiki');
     $data_url = midcom::get()->get_host_name() . midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
     $data['journal_url'] = $data_url . '/__mfa/org.openpsa.relatedto/journalentry/list/xml/';
     midcom_show_style('show-today');
 }
开发者ID:nemein,项目名称:openpsa,代码行数:17,代码来源:today.php


注:本文中的midcom_core_context类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。