示例#1
0
 function get_links()
 {
     $links = parent::get_links();
     $links['Sort Current Projects'] = $this->admin_page->make_link(array('sort_current_projects' => 'true', 'default_sort' => false), true);
     $this->links = $links;
     return $this->links;
 }
 function get_links()
 {
     $links = parent::get_links();
     $es = new entity_selector($this->admin_page->site_id);
     $es->add_type(id_of('event_type'));
     $es->set_order('dated.datetime DESC');
     $values = $es->run_one();
     //should adjust so that can't rearrange slots for events that have only one or no registration slots.
     //also, probably not for past events either.
     if ($values) {
         foreach ($values as $event_id => $event) {
             $es2 = new entity_selector($this->admin_page->site_id);
             $es2->add_type(id_of('registration_slot_type'));
             $es2->add_right_relationship($event_id, relationship_id_of('event_type_to_registration_slot_type'));
             $numSlots = $es2->get_one_count();
             if ($numSlots > 1) {
                 $date = $event->get_value('datetime');
                 $name = 'Sort slots for ' . $event->get_value('name') . ' - ' . prettify_mysql_datetime($date);
                 $link = $this->admin_page->make_link(array('event_id' => $event->id(), 'default_sort' => false), true);
                 $links[$name] = $link;
             }
         }
         $this->links = $links;
         return $this->links;
     }
 }
示例#3
0
 function init()
 {
     parent::init();
     if (!empty($this->admin_page->request['parent_id'])) {
         $x = new entity($this->admin_page->request['parent_id']);
         $this->admin_page->title = 'Sorting Children of "' . $x->get_value('name') . '"';
     } elseif (!$this->is_new()) {
         $this->admin_page->title = 'Sorting Top Level Policies';
     }
 }
示例#4
0
 function get_links()
 {
     $links = parent::get_links();
     foreach ($this->values as $page) {
         if (isset($parents[$page->get_value('parent_id')])) {
             $parents[$page->get_value('parent_id')]['num_children']++;
         } else {
             $parents[$page->get_value('parent_id')] = array('name' => $page->get_value('parent_name'), 'num_children' => 1);
         }
     }
     foreach ($parents as $id => $info) {
         if ($info['num_children'] > 1) {
             $name = 'Sort children of "' . $info['name'] . '"';
             $link = $this->admin_page->make_link(array('parent_id' => $id, 'default_sort' => false), true);
             $links[$name] = $link;
         }
     }
     $this->links = $links;
     return $this->links;
 }