Source for file AdminView.php
Documentation is available at AdminView.php
* DotBoost Technologies Inc.
* DotKernel Application Framework
* @copyright Copyright (c) 2009 DotBoost Technologies (http://www.dotboost.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @version $Id: AdminView.php 165 2010-07-02 07:25:12Z teo $
* class that prepare output related to User controller
* @author DotKernel Team <team@dotkernel.com>
* @param Dot_Template $tpl
$this->settings = Zend_Registry::get('settings');
* @param string $templateFile
$this->tpl->setFile('tpl_main', 'admin/' . $templateFile . '.tpl');
* @param string $templateFile
* @param bool $ajax - Using ajax, parse only the list content
public function listUser($templateFile, $list, $page, $ajax = false)
$this->tpl->setFile('tpl_main', 'admin/' . $templateFile . '.tpl');
$this->tpl->setBlock('tpl_main', 'list', 'list_block');
$this->tpl->paginator($list['paginatorAdapter'],$page);
$this->tpl->setVar('PAGE', $page);
$this->tpl->setVar('ACTIVE_URL', '/admin/admin/activate/');
foreach ($list['data'] as $k => $v)
$this->tpl->setVar('BG', $k% 2+ 1);
$this->tpl->setVar('ID', $v['id']);
$this->tpl->setVar('USERNAME', $v['username']);
$this->tpl->setVar('EMAIL', $v['email']);
$this->tpl->setVar('FIRSTNAME', $v['firstName']);
$this->tpl->setVar('LASTNAME', $v['lastName']);
$this->tpl->setVar('ISACTIVE', $v['isActive']* (- 1)+ 1);
$this->tpl->setVar('ACTIVE_IMG', $v['isActive'] == 1 ? 'active' : 'inactive');
$this->tpl->parse('list_block', 'list', true);
$this->tpl->pparse('AJAX', 'tpl_main');exit;
* Display admin user details. It is used for add and update actions
* @param string $templateFile
* @param array $data [optional]
public function details($templateFile, $data= array())
$this->tpl->setFile('tpl_main', 'admin/' . $templateFile . '.tpl');
$this->tpl->setVar('ACTIVE_1', 'checked');
foreach ($data as $k=> $v)
$this->tpl->setVar('ACTIVE_'. $v, 'checked');
$this->tpl->setVar('ACTIVE_'. $v* (- 1)+ 1, '');
//empty because password is encrypted with md5
$this->tpl->setVar('PASSWORD', '');
* Display user logins list
* @param string $templateFile
public function loginsUser($templateFile, $list, $page)
$this->tpl->setFile('tpl_main', 'admin/' . $templateFile . '.tpl');
$this->tpl->setBlock('tpl_main', 'list', 'list_block');
$this->tpl->paginator($list['paginatorAdapter'],$page);
$this->tpl->setVar('PAGE', $page);
foreach ($list['data'] as $k => $v)
$country = $dotGeoip->getCountryByIp($v['ip']);
$this->tpl->setVar('BG', $k% 2+ 1);
$this->tpl->setVar('ID', $k+ 1);
$this->tpl->setVar('ADMINID', $v['adminId']);
$this->tpl->setVar('USERNAME', $v['username']);
$this->tpl->setVar('IP', $v['ip']);
$this->tpl->setVar('COUNTRYIMAGE', strtolower($country[0]));
$this->tpl->setVar('COUNTRYNAME', $country[1]);
$this->tpl->setVar('REFERER', $v['referer']);
$this->tpl->setVar('WHOISURL', $this->settings->whoisUrl);
$this->tpl->setVar('USERAGENT', $v['userAgent']);
$this->tpl->setVar('OSIMAGE', $os['icon']);
$this->tpl->setVar('OSMAJOR', $os['major']);
$this->tpl->setVar('OSMINOR', $os['minor']);
$this->tpl->parse('list_block', 'list', true);
|