Esempio n. 1
0
 /**
  * Trash view
  *
  * @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_trash($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_admin_user();
     midcom::get('cache')->content->no_cache();
     $data['view_title'] = $this->_l10n->get('trash');
     midcom::get('head')->set_pagetitle($data['view_title']);
     $data['types'] = array();
     foreach (midcom_connection::get_schema_types() as $type) {
         if (substr($type, 0, 2) == '__') {
             continue;
         }
         if (class_exists('midgard_reflector_object')) {
             // In Midgard2 we can have objects that don't
             // have metadata. These should not be shown
             // in trash.
             $ref = new midgard_reflector_object($type);
             if (!$ref->has_metadata_class($type)) {
                 debug_add("{$type} has no metadata, skipping", MIDCOM_LOG_DEBUG);
                 continue;
             }
         }
         $qb = new midgard_query_builder($type);
         $qb->include_deleted();
         $qb->add_constraint('metadata.deleted', '=', true);
         $data['types'][$type] = $qb->count();
     }
     // Set the breadcrumb data
     $this->add_breadcrumb('__mfa/asgard/', $this->_l10n->get('midgard.admin.asgard'));
     $this->add_breadcrumb('__mfa/asgard/trash/', $this->_l10n->get('trash'));
 }
Esempio n. 2
0
 public function getSubtypes()
 {
     $rv = array();
     $children = midgard_reflector_object::list_children($this->classname);
     if (!is_empty($children)) {
         foreach ($children as $name => $v) {
             $children[$name] = new NodeType($name);
         }
     }
     return $rv;
 }