Exemplo n.º 1
0
 function getList()
 {
     $registry = Registry::getInstance();
     $i18n = new I18n($registry->get('i18n_path') . 'admin.xml');
     $renderer = new Renderer(Page::MODE_NORMAL);
     $pTitle = $i18n->get('title');
     $renderer->page->set('title', $pTitle)->set('h1', $pTitle)->set('content', AdminListView::get(['list' => Admin::getList()]));
     $renderer->loadPage();
     $renderer->output();
 }
Exemplo n.º 2
0
 function getList()
 {
     $registry = Registry::getInstance();
     $i18n = new I18n($registry->get('i18n_path') . 'course.xml');
     $data = ['ownerList' => Admin::getList(), 'list' => Course::getList(Course::ALL)];
     $renderer = new Renderer(Page::MODE_NORMAL);
     $pTitle = $i18n->get('title');
     $renderer->page->set('title', $pTitle)->set('h1', $pTitle)->set('content', CourseListView::get($data));
     $renderer->loadPage();
     $renderer->output();
 }
Exemplo n.º 3
0
 function test_AdminGetList()
 {
     $registry = Registry::getInstance();
     $this->adminId = $registry->get('adminId');
     //out( "CMS\Admin->getList()");
     $list = Admin::getList();
     $this->assertNotCount(0, $list, "List Admin: getList() returned empty array on not empty DB. Existing Admin({$this->adminId}) not found.");
     $this->assertArrayHasKey($this->adminId, $list, "List Admin: Existing Admin({$adminId}) not found by getList()");
     $admin = $list[$this->adminId];
     $this->assertInstanceOf('common\\Admin', $admin, "List Admin: getList() item is not an instance of Admin.");
     $this->assertEquals($this->adminId, $admin->id, "Admin getList: Error getting admin->id");
     $this->assertEquals($this->data[1]['admin_description'], $admin->description, "Admin getList: Error getting admin->description");
     $this->assertEquals($this->data[1]['admin_email'], $admin->email, "Admin getList: Error getting admin->email");
     $this->assertEquals($this->data[1]['admin_login'], $admin->login, "Admin getList: Error getting admin->login");
     $this->assertEquals($this->data[1]['admin_name'], $admin->name, "Admin getList: Error getting admin->name");
     $this->assertEquals(Admin::passwordEncode($this->data[1]['admin_password']), $admin->password, "Admin getList: Error getting admin->password");
     $this->assertEquals($this->data[1]['admin_state'], $admin->state, "Admin getList: Error getting admin->state");
     $this->assertEquals($this->data[1]['admin_rights'], $admin->rights, "Admin getList: Error getting admin->rights");
     $this->assertEquals($this->data[1]['admin_locale'], $admin->locale, "Admin getList: Error getting admin->locale");
     unset($admin);
 }