Beispiel #1
0
 /**
  * 自定义一个图片控件,该控件只对当前控制器页面有效
  *  
  * @param array 控件参数
  */
 public function image($attrs)
 {
     $html = array();
     $html[] = field::hidden($attrs);
     $html[] = '<div class="textarea" style="margin-top:-1px;height:100px;">';
     $html[] = '	<ul class="zotop-image-list" id="' . $attrs['name'] . '-images">';
     for ($i = 0; $i < 10; $i++) {
         $image = url::theme() . '/image/userface/' . $i . '.gif';
         $class = $attrs['value'] == $image ? 'selected' : 'normal';
         $html[] = '		<li class="' . $class . '"><a href="javascript:void(0);" onfocus="blur()"><img src="' . $image . '" style="width:64px;height:64px;"></a></li>';
     }
     $html[] = '	</ul>';
     $html[] = '</div>';
     $html[] = '
     <script>
     	$(function(){
 			var name = "' . $attrs['name'] . '";
     		var id = "#' . $attrs['name'] . '-images";
     		$(id).find("li").click(function(){
 				var image = $(this).find("img").attr("src");
 				$(this).parents("ul").find("li").removeClass("selected");
 				$(this).addClass("selected");
 				$("#"+name).val(image);
 			})
 		});        
     </script>
     ';
     return implode("\n", $html);
 }
Beispiel #2
0
 public static function header($page = array())
 {
     $page['js'] = array_merge(array('jquery' => url::common() . '/js/jquery.js', 'plugins' => url::common() . '/js/jquery.plugins.js', 'zotop' => url::common() . '/js/zotop.js'), (array) $page['js']);
     $page['css'] = array_merge(array('zotop' => url::theme() . '/css/zotop.css', 'global' => url::theme() . '/css/global.css'), (array) $page['css']);
     $page = self::settings($page);
     $html[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $html[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
     $html[] = '<head>';
     $html[] = '	<title>' . $page['title'] . ' Powered by ' . zotop::config("zotop.title") . '</title>';
     $html[] = self::meta($page['meta']);
     $html[] = self::stylesheet($page['css']);
     $html[] = self::script($page['js']);
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'bookmark', 'type' => 'image/x-icon'));
     $html[] = '	<script type="text/javascript">';
     $html[] = '		zotop.url.base = "' . url::base() . '";';
     $html[] = '		zotop.url.common = "' . url::common() . '";';
     $html[] = '		zotop.page.id = "' . page::id() . '";';
     $html[] = '		zotop.user.id =0;';
     $html[] = '		zotop.user.username = "";';
     $html[] = '	</script>';
     $html[] = '</head>';
     $html[] = '<body' . html::attributes($page['body']) . '>';
     $html[] = '<div id="wrapper">';
     $html[] = '';
     $str = implode("\n", $html);
     echo $str;
 }
Beispiel #3
0
 public function getUnInstalled()
 {
     $installed = (array) $this->getInstalled();
     $folders = dir::folders(ZPATH_MODULES, '.', false);
     $folders = array_diff($folders, array_keys($installed));
     $modules = array();
     foreach ($folders as $folder) {
         $modulePath = ZPATH_MODULES . DS . $folder;
         $moduleUrl = url::modules() . '/' . $folder;
         $moduleFile = $modulePath . DS . 'module.php';
         if (file::exists($moduleFile)) {
             $m = (include $moduleFile);
             $m['path'] = '$modules/' . $folder;
             $m['url'] = '$modules/' . $folder;
             if (!isset($m['icon'])) {
                 if (!file::exists($modulePath . '/icon.png')) {
                     $m['icon'] = url::theme() . '/image/skin/none.png';
                 } else {
                     $m['icon'] = $moduleUrl . '/icon.png';
                 }
             }
             $modules[$m['id']] = $m;
         }
     }
     return $modules;
 }
Beispiel #4
0
 /**
  * 表情转换,可以通过hook(zotop.smiles)扩展
  * 
  *
  */
 public static function smiles($str)
 {
     $smiles = array(':)' => url::theme() . '/image/smiles/smile.gif', ':-)' => url::theme() . '/image/smiles/cool.gif');
     $smiles = zotop::filter('zotop.smiles', $smiles);
     foreach ($smiles as $key => $val) {
         $str = str_replace($key, '<img src=' . $val . ' class="zotop-smile"/>', $str);
     }
     return $str;
 }
Beispiel #5
0
 public static function header($header = array())
 {
     $attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
     $attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
     $attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
     $html[] = isset($header['title']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
     $html[] = html::script(url::theme() . '/js/jquery.form.js');
     $html[] = html::script(url::theme() . '/js/zotop.form.js');
     echo implode("\n", $html);
 }
Beispiel #6
0
 public function onDefault()
 {
     $module = zotop::model('zotop.module');
     $list = $module->getAll(array('select' => '*', 'orderby' => 'updatetime desc'));
     $module->getStructure();
     $page['title'] = '模块管理';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header();
     $column = array();
     $column['status w30 center'] = '状态';
     $column['modulename'] = '模块ID';
     $column['name'] = '模块名称';
     $column['path'] = '安装目录';
     $column['varsion w60 center'] = '版本号';
     $column['updatetime w150'] = '更新时间';
     $column['manage lock'] = '锁定';
     $column['manage rename'] = '设置';
     $column['manage edit'] = '权限';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($list as $module) {
         $module['status-icon'] = $module['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/ok.gif');
         $column = array();
         $column['status w30 center'] = $module['status-icon'];
         $column['name w80'] = $module['id'];
         $column['modulename'] = '<a><b>' . $module['name'] . '</b></a><h5>' . $module['description'] . '</h5>';
         $column['loginnum w60'] = $module['path'];
         $column['loginip w60 center'] = $module['version'];
         $column['logintime w150'] = time::format($module['updatetime']);
         if ($module['status'] == -1) {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'], 'status' => 0)) . '">启用</a>';
         } else {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'])) . '">禁用</a>';
         }
         $column['manage setting'] = '<a href="' . zotop::url('zotop/module/setting', array('id' => $module['id'])) . '">设置</a>';
         $column['manage priv'] = '<a href="' . zotop::url('zotop/module/priv', array('id' => $module['id'])) . '">权限</a>';
         $column['manage delete'] = '<a>卸载</a>';
         table::row($column);
     }
     table::footer();
     form::buttons();
     form::footer();
     page::bottom();
     page::footer();
 }
Beispiel #7
0
 public function onDefault()
 {
     $User = zotop::model('zotop.user');
     $list = $User->getAll(array('select' => '*', 'where' => array('modelid', '=', 'system'), 'orderby' => 'logintime desc'));
     $page['title'] = '系统用户管理';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header();
     $column = array();
     $column['status w30 center'] = '状态';
     $column['username'] = '******';
     $column['name'] = '姓名';
     $column['loginnum'] = '登录次数';
     $column['loginip w120'] = '登录IP';
     $column['logintime w150'] = '登录时间';
     $column['manage lock'] = '锁定';
     $column['manage rename'] = '修改密码';
     $column['manage edit'] = '编辑';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($list as $user) {
         $user['status-icon'] = $user['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/user.gif');
         $column = array();
         $column['status w30 center'] = $user['status-icon'];
         $column['username'] = '******' . $user['username'] . '</b></a><h5>' . $user['email'] . '</h5>';
         $column['name w60'] = $user['name'];
         $column['loginnum w60'] = $user['loginnum'];
         $column['loginip w120'] = $user['loginip'];
         $column['logintime w150'] = time::format($user['logintime']);
         if ($user['status'] == -1) {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/user/lock', array('id' => $user['id'], 'status' => 0)) . '">解锁</a>';
         } else {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/user/lock', array('id' => $user['id'])) . '">锁定</a>';
         }
         $column['manage rename'] = '<a href="' . zotop::url('zotop/user/changepassword', array('id' => $user['id'])) . '">修改密码</a>';
         $column['manage edit'] = '<a href="' . zotop::url('zotop/user/changeinfo', array('id' => $user['id'])) . '">编辑</a>';
         $column['manage delete'] = '<a>删除</a>';
         table::row($column);
     }
     table::footer();
     form::buttons();
     form::footer();
     page::bottom();
     page::footer();
 }
Beispiel #8
0
 public function onDefault()
 {
     $role = zotop::model('zotop.role');
     $list = $role->getAll(array('select' => '*', 'orderby' => 'order desc'));
     $page['title'] = '系统用户管理';
     //zotop::dump($role->db()->lastsql());
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header();
     $column = array();
     $column['status w30 center'] = '状态';
     $column['id w30 center'] = '编号';
     $column['rolename'] = '角色名称';
     $column['manage lock'] = '锁定';
     $column['manage edit'] = '编辑';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($list as $role) {
         $role['status-icon'] = $role['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/ok.gif');
         $column = array();
         $column['status w30 center'] = $role['status-icon'];
         $column['id w30 center'] = $role['id'];
         $column['rolename'] = '<a><b>' . $role['name'] . '</b></a><h5>' . $role['description'] . '</h5>';
         if ($role['status'] == -1) {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/role/lock', array('id' => $role['id'], 'status' => 0)) . '">解锁</a>';
         } else {
             $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/role/lock', array('id' => $role['id'])) . '">锁定</a>';
         }
         $column['manage edit'] = '<a href="' . zotop::url('zotop/role/edit', array('id' => $role['id'])) . '">编辑</a>';
         $column['manage delete'] = '<a>删除</a>';
         table::row($column);
     }
     table::footer();
     form::buttons();
     form::footer();
     page::bottom();
     page::footer();
 }
Beispiel #9
0
 public function header()
 {
     $javascript = (array) $this->js;
     $css = (array) $this->css;
     $metas = (array) $this->meta;
     $html[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $html[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
     $html[] = '<head>';
     $html[] = '	<title>' . $this->title . ' ' . zotop::config("zotop.title") . '</title>';
     $html[] = '	' . html::meta('keywords', $this->keywords . ' ' . zotop::config("zotop.keywords"));
     $html[] = '	' . html::meta('description', $this->description . ' ' . zotop::config("zotop.description"));
     $html[] = '	' . html::meta('Content-Type', 'text/html;charset=utf-8');
     $html[] = '	' . html::meta('X-UA-Compatible', 'IE=EmulateIE7');
     foreach ($metas as $meta) {
         $html[] = '	' . html::meta($meta);
     }
     $html[] = '	' . html::stylesheet(url::theme() . '/css/zotop.css', array('id' => 'zotop'));
     $html[] = '	' . html::stylesheet(url::theme() . '/css/global.css', array('id' => 'global'));
     foreach ($css as $stylesheet) {
         $html[] = '	' . html::stylesheet($stylesheet);
     }
     $html[] = '	' . html::script(url::common() . '/js/jquery.js', array('id' => 'jquery'));
     $html[] = '	' . html::script(url::common() . '/js/jquery.plugins.js', array('id' => 'plugins'));
     $html[] = '	' . html::script(url::common() . '/js/zotop.js', array('id' => 'zotop'));
     $html[] = '	' . html::script(url::common() . '/js/global.js', array('id' => 'global'));
     foreach ($javascript as $js) {
         $html[] = '	' . html::script($js);
     }
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'bookmark', 'type' => 'image/x-icon'));
     $html[] = '</head>';
     $html[] = '<body' . html::attributes($this->body) . '>';
     $html[] = '<div id="wrapper">';
     $html[] = '<div id="page">';
     $html[] = '';
     echo implode("\n", $html);
 }
Beispiel #10
0
 public static function header($header = array())
 {
     $header = self::settings($header);
     $html[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $html[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
     $html[] = '<head>';
     $html[] = '	<title>' . $header['title'] . ' Powered by ' . zotop::config("zotop.title") . '</title>';
     $html[] = self::meta($header['meta']);
     $html[] = self::stylesheet($header['css']);
     $html[] = self::script($header['js']);
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
     $html[] = '	<script type="text/javascript">';
     $html[] = '		zotop.user.id =0;';
     $html[] = '		zotop.user.username = "";';
     $html[] = '		zotop.url.base = "' . url::base() . '";';
     $html[] = '	</script>';
     $html[] = '</head>';
     $html[] = '<body' . html::attributes($header['body']) . '>';
     $html[] = '<div id="wrapper">';
     $html[] = '';
     $str = implode("\n", $html);
     echo $str;
 }
Beispiel #11
0
 public function notInstalled()
 {
     $datalist = (array) $this->datalist();
     $folders = dir::folders(ZOTOP_MODULES, '.', false);
     $folders = array_diff($folders, array_keys($datalist));
     $modules = array();
     foreach ($folders as $folder) {
         $modulePath = ZOTOP_MODULES . DS . $folder;
         $moduleUrl = url::modules() . '/' . $folder;
         $moduleFile = $modulePath . DS . 'module.php';
         if (file::exists($moduleFile)) {
             $m = (include $moduleFile);
             if (!isset($m['icon'])) {
                 $m['icon'] = $moduleUrl . '/icon.gif';
                 if (!file::exists($m['icon'])) {
                     $m['icon'] = url::theme() . '/image/icon/module.gif';
                 }
             }
             $modules[$m['id']] = $m;
         }
     }
     return $modules;
 }
Beispiel #12
0
} else {
    $column = array();
    $column['status w30 center'] = '状态';
    //$column['modulename'] = '模块ID';
    $column['name'] = '模块名称 ( 模块ID )';
    //$column['path'] = '安装目录';
    $column['varsion w60 center'] = '版本号';
    $column['updatetime'] = '更新时间';
    $column['manage rename'] = '设置';
    $column['manage edit'] = '权限';
    $column['manage lock'] = '禁用';
    $column['manage delete'] = '卸载';
    table::header('list', $column);
    foreach ($modules as $module) {
        $module['root'] = ZPATH_MODULES . DS . $module['id'];
        $module['status-icon'] = $module['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/ok.gif');
        $column = array();
        $column['status w30 center'] = $module['status-icon'];
        //$column['name w60'] = $module['id'];
        $column['name'] = '<a class="dialog" href="' . zotop::url('zotop/module/about', array('id' => $module['id'])) . '"><b>' . $module['name'] . ' ( ' . $module['id'] . ' )</b></a><h5>' . $module['description'] . '</h5>';
        //$column['loginnum w60'] = $module['path'];
        $column['loginip w60 center'] = $module['version'];
        $column['logintime w130'] = time::format($module['updatetime']);
        $column['manage setting'] = file::exists($module['root'] . DS . 'admin' . DS . 'settings.php') ? '<a href="' . zotop::url('zotop/module/setting', array('id' => $module['id'])) . '">设置</a>' : '<span class="disabled">设置</span>';
        $column['manage priv'] = file::exists($module['root'] . DS . 'admin' . DS . 'priv.php') ? '<a href="' . zotop::url('zotop/module/priv', array('id' => $module['id'])) . '">权限</a>' : '<span class="disabled">权限</span>';
        if ($module['type'] == 'core') {
            $column['manage lock'] = '<span class="disabled">禁用</span>';
        } else {
            if ($module['status'] == -1) {
                $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'], 'status' => 0)) . '">启用</a>';
            } else {
Beispiel #13
0
 public static function stylesheet($files)
 {
     $default['zotop'] = url::theme() . '/css/zotop.css';
     $default['global'] = url::theme() . '/css/global.css';
     //用户的meta
     $files = array_merge($default, (array) $files);
     foreach ($files as $file) {
         $html[] = '	' . html::stylesheet($file) . '';
     }
     return implode("\n", $html);
 }
Beispiel #14
0
 public function onDefault($dir = '')
 {
     $path = ROOT . DS . trim($dir, DS);
     $path = path::clean($path);
     $folders = dir::folders($path);
     $files = dir::files($path);
     $fileext = array('php', 'css', 'js', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'psd', 'html', 'htm', 'tpl', 'rar', 'zip', 'mp3');
     $page['title'] = '文件管理器';
     page::header($page);
     page::add('<div id="page" class="clearfix">');
     page::add('<div id="main">');
     page::add('<div id="main-inner">');
     page::top();
     page::navbar($this->navbar(), 'default');
     $column = array();
     $column['select'] = '';
     $column['name'] = '名称';
     $column['type'] = '类型';
     $column['size w60'] = '大小';
     $column['atime w120'] = '创建时间';
     $column['mtime w120'] = '修改时间';
     $column['manage rename w80'] = '重命名';
     $column['manage edit w80'] = '编辑';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($folders as $folder) {
         $column = array();
         $column['select w20 center'] = html::image(url::theme() . '/image/fileext/folder.gif');
         $column['name'] = '<a href="' . zotop::url('filemanager/index/default', array('dir' => $dir . DS . $folder)) . '"><b>' . $folder . '</b></a>';
         $column['type w60'] = '文件夹';
         $column['size w60'] = '--';
         $column['atime w120'] = time::format(@fileatime($path . DS . $folder));
         $column['mtime w120'] = time::format(@filemtime($path . DS . $folder));
         $column['manage rename w80'] = '<a>重命名</a>';
         $column['manage edit w80'] = '<a class="disabled">编辑</a>';
         $column['manage delete'] = '<a>删除</a>';
         table::row($column);
     }
     foreach ($files as $file) {
         $column = array();
         $column['select w20 center'] = in_array(file::ext($file), $fileext) ? html::image(url::theme() . '/image/fileext/' . file::ext($file) . '.gif') : html::image(url::theme() . '/image/fileext/unknown.gif');
         $column['name'] = '<a href="' . zotop::url('filemanager/index/default', array('dir' => $dir . DS . $file)) . '"><b>' . $file . '</b></a>';
         $column['type w60'] = '文件';
         $column['size w60'] = format::byte(@filesize($path . DS . $file));
         $column['atime w120'] = time::format(@fileatime($path . DS . $file));
         $column['mtime w120'] = time::format(@filemtime($path . DS . $file));
         $column['manage rename w80'] = '<a>重命名</a>';
         $column['manage edit w80'] = '<a href="' . zotop::url('filemanager/file/edit', array('filename' => $dir . DS . $file, 'dir' => '***')) . '">编辑</a>';
         $column['manage delete'] = '<a>删除</a>';
         table::row($column);
     }
     table::footer();
     page::bottom();
     page::add('</div>');
     page::add('</div>');
     page::add('<div id="side">');
     block::header('快捷操作');
     echo '<ul class="list">';
     echo '<li class="file"><a href="' . zotop::url('zotop/file/newfile') . '" class="dialog">新建文件</a></li>';
     echo '<li class="folder"><a href="' . zotop::url('zotop/file/newfolder') . '" class="dialog">新建文件夹</a></li>';
     echo '<li class="folder"><a href="' . zotop::url('zotop/file/upload') . '" class="dialog">文件上传</a></li>';
     echo '</ul>';
     block::footer();
     block::header('其他位置');
     echo '<ul class="list">';
     echo '<li class="root"><a>根目录</a></li>';
     echo '<li class="root"><a>模板目录</a></li>';
     echo '<li class="root"><a>模块目录</a></li>';
     echo '<li class="root"><a>缓存目录</a></li>';
     echo '</ul>';
     block::footer();
     page::add('</div>');
     page::add('</div>');
     page::footer();
 }
Beispiel #15
0
 public static function decode($url)
 {
     $url = strtr($url, array('$root' => url::root(), '$system' => url::system(), '$theme' => url::theme(), '$modules' => url::modules(), '$this' => url::controller(), '$common' => url::common()));
     return $url;
 }
Beispiel #16
0
 public static function decode($url)
 {
     $url = str_replace(array('%root%', '%zotop%', '%theme%', '%module%'), array(url::root(), url::zotop(), url::theme(), url::module()), $url);
     return $url;
 }
Beispiel #17
0
 public function header()
 {
     $html[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $html[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
     $html[] = '<head>';
     $html[] = '	<title>' . $this->title . ' ' . zotop::config("zotop.title") . '</title>';
     $html[] = '	' . html::meta('keywords', $this->keywords);
     $html[] = '	' . html::meta('description', $this->description);
     $html[] = '	' . html::meta('Content-Type', 'text/html;charset=utf-8');
     $html[] = '	' . html::meta('X-UA-Compatible', 'IE=EmulateIE7');
     $html[] = '	' . html::stylesheet(url::theme() . '/css/zotop.css', array('id' => 'zotop'));
     $html[] = '	' . html::stylesheet(url::theme() . '/css/global.css', array('id' => 'global'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(url::theme() . '/image/fav.ico', array('rel' => 'bookmark', 'type' => 'image/x-icon'));
     //$html[] = page::meta($header['meta']);
     //$html[] = page::stylesheet($header['css']);
     //$html[] = page::script($header['js']);
     $html[] = '</head>';
     $html[] = '<body' . html::attributes($this->body) . '>';
     $str = implode("\n", $html);
     echo $str;
 }
Beispiel #18
0
<?php 
if (empty($usergroups)) {
    echo '<div class="zotop-empty"><span>暂时没有数据</span></div>';
} else {
    $column = array();
    $column['status w30 center'] = '状态';
    $column['id w30 center'] = '编号';
    $column['usergroupname'] = '用户组名称';
    $column['manage p'] = '权限设定';
    $column['manage status'] = '状态';
    $column['manage edit'] = '编辑';
    $column['manage delete'] = '删除';
    table::header('list', $column);
    foreach ($usergroups as $usergroup) {
        $usergroup['status-icon'] = $usergroup['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/ok.gif');
        $column = array();
        $column['status w30 center'] = $usergroup['status-icon'];
        $column['id w30 center'] = $usergroup['id'];
        $column['usergroupname'] = '<a><b>' . $usergroup['title'] . '</b></a><h5>' . $usergroup['description'] . '</h5>';
        $column['manage p'] = '<a href="' . zotop::url('zotop/usergroup/edit', array('id' => $usergroup['id'])) . '">权限设定</a>';
        if ($usergroup['status'] == -1) {
            $column['manage status'] = '<a class="confirm" href="' . zotop::url('zotop/usergroup/status', array('id' => $usergroup['id'], 'status' => 0)) . '">解锁</a>';
        } else {
            $column['manage status'] = '<a class="confirm" href="' . zotop::url('zotop/usergroup/status', array('id' => $usergroup['id'])) . '">锁定</a>';
        }
        $column['manage edit'] = '<a href="' . zotop::url('zotop/usergroup/edit', array('id' => $usergroup['id'])) . '">编辑</a>';
        $column['manage delete'] = '<a href="' . zotop::url('zotop/usergroup/delete', array('id' => $usergroup['id'])) . '" class="confirm">删除</a>';
        table::row($column);
    }
    table::footer();
Beispiel #19
0
 public static function script($files)
 {
     $default['jquery'] = url::theme() . '/js/jquery.js';
     $default['plugins'] = url::theme() . '/js/jquery.plugins.js';
     $default['zotop'] = url::theme() . '/js/zotop.js';
     //用户的meta
     $files = array_merge($default, (array) $files);
     foreach ($files as $file) {
         $html[] = '	' . html::script($file);
     }
     return implode("\n", $html);
 }