当前位置: 首页>>代码示例>>PHP>>正文


PHP page::add方法代码示例

本文整理汇总了PHP中page::add方法的典型用法代码示例。如果您正苦于以下问题:PHP page::add方法的具体用法?PHP page::add怎么用?PHP page::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在page的用法示例。


在下文中一共展示了page::add方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onDefault

 public function onDefault()
 {
     $site = array();
     $site['name'] = zotop::config('zotop.site.name');
     $site['totalsize'] = zotop::config('zotop.ftp.size');
     $site['totalsize'] = (int) $site['totalsize'] == 0 ? '--' : format::byte($site['totalsize']);
     $database = array();
     $database['size'] = zotop::db()->size();
     $database['size'] = format::byte($database['size']);
     $page['title'] = '控制中心';
     $page['css'][] = url::module() . '/admin/css/main.css';
     zotop::add('zotop.main.main', array(&$this, 'notepad'));
     zotop::add('zotop.main.main', array(&$this, 'mylog'));
     page::header($page);
     page::top();
     page::navbar($this->navbar(), 'main');
     page::add('');
     page::add('<div id="user" class="clearfix">');
     page::add('	<div id="userface"><span class="image">' . html::image(zotop::user('image')) . '</span></div>');
     page::add('	<div id="userinfo">');
     page::add('	<h2 id="welcome">欢迎您,' . zotop::user('name') . ' <span id="sign">' . zotop::user('sign') . '</span></h2>');
     page::add('	<div id="login">登录时间:' . time::format(zotop::user('logintime')) . ' 登录次数:' . zotop::user('loginnum') . ' 登录IP:' . zotop::user('loginip') . '</div>');
     //加载hook
     zotop::run('zotop.main.action');
     page::add('');
     page::add('</div>');
     page::add('<div class="grid-m-s">');
     page::add('<div class="col-main">');
     page::add('<div class="col-main-inner">');
     zotop::run('zotop.main.main');
     page::add('</div>');
     page::add('</div>');
     page::add('<div class="col-sub">');
     zotop::run('zotop.main.sub');
     block::header(array('title' => '网站信息', 'action' => '<a class="more" href="' . zotop::url('zotop/info/site') . '">详细</a>'));
     echo '<table class="table">';
     echo '<tr><td class="w80">网站名称:</td><td>' . $site['name'] . '</td></tr>';
     echo '<tr><td class="w80">空间占用:</td><td>' . $site['totalsize'] . '</td></tr>';
     echo '<tr><td class="w80">已上传文件:</td><td></td></tr>';
     echo '<tr><td class="w80">数据库大小:</td><td>' . $database['size'] . '</td></tr>';
     echo '</table>';
     block::footer();
     block::header(array('title' => '系统信息', 'action' => '<a class="more" href="' . zotop::url('zotop/main/system') . '">详细</a>'));
     echo '<table class="table">';
     echo '<tr><td class="w80">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
     echo '<tr><td class="w80">程序设计:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
     echo '<tr><td class="w80">程序开发:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
     echo '<tr><td class="w80">官方网站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
     echo '<tr><td class="w80">安装时间:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
     echo '</table>';
     block::footer();
     page::add('</div>');
     page::add('</div>');
     page::bottom('<span class="zotop-tip">上次登录时间:' . time::format(zotop::user('logintime')) . '</span>');
     page::footer();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:56,代码来源:main.php

示例2: onDefault

 public function onDefault()
 {
     $tables = $this->db->table()->get(true);
     $header['title'] = '数据库管理';
     page::header($header);
     page::add('<div id="page" class="clearfix">');
     page::add('<div id="side">');
     block::header('数据库基本信息');
     table::header();
     table::row(array('w60' => '数据库名称', '2' => '' . $this->db->config['database'] . ''));
     table::row(array('w60' => '数据库版本', '2' => '' . $this->db->version(true) . ''));
     table::row(array('w60' => '数据库大小', '2' => '<b>' . $this->db->size() . '</b> '));
     table::row(array('w60' => '数据表个数', '2' => '<b>' . count($tables) . '</b> 个'));
     table::footer();
     block::footer();
     page::add('</div>');
     page::add('<div id="main">');
     page::top();
     page::navbar($this->navbar(), 'table');
     //zotop::dump($tables);
     form::header(array('class' => 'ajax'));
     $column['select'] = '<input name="id" class="selectAll" type="checkbox"/>';
     $column['name'] = '数据表名称';
     $column['size  w60'] = '大小';
     $column['Rows  w60'] = '记录数';
     $column['Engine  w60'] = '类型';
     $column['Collation  w100'] = '整理';
     $column['manage view w60'] = '浏览';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($tables as $table) {
         $size = $table['Data_length'] + $table['Index_length'];
         $column = array();
         $column['select'] = '<input name="id[]" class="select" type="checkbox"/>';
         $column['name'] = '<b>' . $table['Name'] . '</b><h5>' . $table['Comment'] . '</h5>';
         $column['size w60'] = (string) format::size($size);
         $column['Rows  w60'] = $table['Rows'];
         $column['Engine  w60'] = $table['Engine'];
         $column['collation  w100'] = $table['Collation'];
         $column['manage view w60'] = '<a href="' . url::build('system/database/table/record') . '">浏览</a>';
         $column['manage delete'] = '<a href="' . url::build('system/database/table/delete') . '" class="confirm">删除</a>';
         table::row($column);
     }
     table::footer();
     page::add('<div style="height:200px;"></div>');
     form::buttons(array('type' => 'select', 'style' => 'width:180px', 'options' => array('check' => '优化', 'delete' => '删除')), array('type' => 'submit', 'value' => '执行操作'));
     form::footer();
     page::bottom();
     page::add('</div>');
     page::add('</div>');
     page::footer();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:52,代码来源:database.php

示例3: show

 public static function show($msg = array())
 {
     $header['title'] = '用户登录';
     $header['body']['class'] = "msg";
     page::header($header);
     page::add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
     page::add('	<div id="msg-type">' . $msg['type'] . '</div>');
     page::add('	<div id="msg-life">' . $msg['life'] . '</div>');
     page::add('	<div class="zotop-msg zotop-msg-' . $msg['type'] . '">');
     page::add('		<div class="zotop-msg-icon"></div>');
     page::add('		<div class="zotop-msg-content">');
     page::add('			<div id="msg-title">' . $msg['title'] . '</div>');
     page::add('			<div id="msg-content">' . $msg['content'] . '</div>');
     page::add('			<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
     page::add('			<div id="msg-extra">' . $msg['extra'] . '</div>');
     page::add('			<div id="msg-powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
     page::add('		</div>');
     page::add('		</div>');
     page::add('</div>');
     page::footer();
     exit;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:22,代码来源:msg.php

示例4: authSMA

<?php

require_once "../../config.inc.php";
require_once $c["path"] . "api/auth/auth_sma.php";
$sid = $_COOKIE["nxwcms"];
$auth = new authSMA("B_LIVE_AUTHORING", false);
$disableMenu = true;
$page = new page("SMA Editor");
$sma = 1;
$oid = value("oid", "NUMERIC");
if ($oid != "0") {
    includePGNISources();
    $page_action = "UPDATE";
    $go = "-";
    $form = new EditForm($lang->get("ed_content"));
    $jsupdate = new HTMLContainer("con", "standard", 2);
    $jsupdate->add("<script language=\"JavaScript\">opener.document.location.reload();window.close();</script>");
    $ref = createPGNRef(getModuleFromCLC($oid), $oid);
    $ref->edit($form);
    if ($page_state == "processing") {
        $form->add($jsupdate);
    }
    $page->add($form);
}
$page->draw();
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:25,代码来源:sma_editor.php

示例5: auth

$auth = new auth("EXPORT");
$page = new page("Export");
$wizard = new Wizard($lang->get("export_data", "Export Content and Templates Wizard"));
$wizard->setTitleText($lang->get("wz_export_title", "This wizard is used to exchange clusters, cluster-templates and page-templates between your N/X installation and others. The wizard generates a XML File, which you can store on your local hard drive and exchange with other N/X-Users."));
////// STEP 1 //////
$step = new Step();
$step->setTitle($lang->get("wzt_export_type", "Select type to export"));
$step->setExplanation($lang->get("wze_export_type", "On the right you need to select the type of data you want to export. Clusters are storing content. When you export clusters, the templates are automatically exported too. Cluster-Templates are schemes for creating clusters. Page-Templates are used for creating pages in the website. Cluster-Templates, Meta-Templates and layout are automatically exported when you export a Page-Template."));
$resources[0][0] = $lang->get("cluster", "Cluster");
$resources[0][1] = "CLUSTER";
$resources[1][0] = $lang->get("cluster_template", "Cluster Template");
$resources[1][1] = "CLUSTERTEMPLATE";
$resources[2][0] = $lang->get("page_template", "Page Template");
$resources[2][1] = "PAGETEMPLATE";
$step->add(new WZRadio("resource_type", $resources));
////// STEP 2 //////
$step2 = new STSelectResource();
$step2->setTitle($lang->get("wzt_sel_exp_res", "Select Resource for export"));
////// STEP 3 //////
$step3 = new Step();
$step3->setTitle($lang->get("wzt_descr", "Add description"));
$step3->setExplanation($lang->get("wzt_descr_expl", "You should add a short description to the exported data.<br/><br/> Anyone who will import the data will easier understand, what he exports."));
$step3->add(new WZText("exp_description", $lang->get("description", "Description"), "TEXTAREA"));
////// Step 4 //////
$step4 = new STExportResource();
$wizard->add($step);
$wizard->add($step2);
$wizard->add($step3);
$wizard->add($step4);
$page->add($wizard);
$page->draw();
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:31,代码来源:wz_export.php

示例6: show

 public static function show(array $msg)
 {
     $page = new page();
     $page->title = $msg['type'];
     $page->body = array('class' => 'msg');
     $page->header();
     $page->add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
     $page->add('	<div id="msg-type">' . $msg['type'] . '</div>');
     $page->add('	<div id="msg-life">' . $msg['life'] . '</div>');
     $page->add('	<div id="msg-title">' . $msg['title'] . '</div>');
     $page->add('	<div id="msg-content">' . $msg['content'] . '</div>');
     $page->add('	<div id="msg-extra">' . $msg['extra'] . '</div>');
     if (!empty($msg['url'])) {
         $page->add('	<div>');
         $page->add('		<div><b>如果页面没有自动跳转,请点击以下链接</b></div>');
         $page->add('		<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
         $page->add('	</div>');
     }
     $page->add('</div>');
     $page->add('<div id="powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
     $page->footer();
     exit;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:23,代码来源:msg.php

示例7: array

    $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '修改时间降序', '修改时间升序', '浏览次数降序', '浏览次数升序');
    $dorder = array('addtime DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'hits DESC', 'hits ASC');
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $fields_select = dselect($sfields, 'fields', '', $fields);
    $order_select = dselect($sorder, 'order', '', $order);
    $condition = '';
    if ($keyword) {
        $condition .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'";
    }
}
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&catid=' . $post['catid']);
            } else {
                msg($do->errmsg);
            }
        } else {
            foreach ($do->fields as $v) {
                isset(${$v}) or ${$v} = '';
            }
            $content = '';
            $username = $_username;
            $status = 3;
            $addtime = timetodate($DT_TIME);
            $menuid = 0;
            $listorder = 0;
            include tpl('page_edit', $module);
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:page.inc.php

示例8: onDefault

 public function onDefault()
 {
     $db = zotop::db();
     $host = $db->config('hostname');
     $dbName = $db->config('database');
     $dbVersion = $db->version(true);
     $dbSize = $db->size();
     $tables = zotop::db()->tables(true);
     $header['title'] = '数据库管理:' . $dbName;
     page::header($header);
     page::add('<div id="page" class="clearfix">');
     page::add('<div id="side">');
     block::header('数据库基本信息');
     table::header();
     table::row(array('w60' => '数据库主机', '2' => '' . $host . ''));
     table::row(array('w60' => '数据库名称', '2' => '' . $dbName . ''));
     table::row(array('w60' => '数据库版本', '2' => '' . $dbVersion . ''));
     table::row(array('w60' => '数据库大小', '2' => '<b>' . $dbSize . '</b> '));
     table::row(array('w60' => '数据表个数', '2' => '<b>' . count($tables) . '</b> 个'));
     table::footer();
     block::footer();
     block::header('创建数据表');
     form::header(array('action' => zotop::url('database/table/create'), 'template' => 'div'));
     form::field(array('type' => 'text', 'name' => 'tablename', 'label' => zotop::t('表名称'), 'style' => 'width:180px', 'valid' => '{required:true}', 'description' => '不含前缀,系统会自动加上前缀'));
     form::buttons(array('type' => 'submit', 'value' => '创建'));
     form::footer();
     block::footer();
     page::add('</div>');
     page::add('<div id="main">');
     page::top();
     page::navbar($this->navbar(), 'tables');
     //zotop::dump($tables);
     form::header(array('class' => 'list', 'action' => zotop::url('database/table/action')));
     $column['select'] = html::checkbox(array('name' => 'table', 'class' => 'selectAll'));
     $column['name'] = '数据表名称';
     $column['size  w60'] = '大小';
     $column['Rows  w60'] = '记录数';
     $column['Engine  w60'] = '类型';
     $column['Collation  w100'] = '整理';
     $column['manage view w60'] = '浏览';
     $column['manage delete'] = '删除';
     page::add('<div style="height:400px;">');
     table::header('list', $column);
     foreach ($tables as $table) {
         $column = array();
         $column['select'] = html::checkbox(array('name' => 'table[]', 'value' => $table['name'], 'class' => 'select'));
         $column['name'] = '<a href="' . url::build('database/field/default', array('tablename' => $table['name'])) . '"><b>' . $table['name'] . '</b></a><h5>' . $table['comment'] . '</h5>';
         $column['size w60'] = (string) format::byte($table['size']);
         $column['Rows  w60'] = $table['rows'];
         $column['Engine  w60'] = $table['engine'];
         $column['collation  w100'] = $table['collation'];
         $column['manage view w60'] = '<a href="' . url::build('database/table/edit', array('tablename' => $table['name'])) . '">设置</a>';
         $column['manage delete'] = '<a href="' . url::build('database/table/delete', array('tablename' => $table['name'])) . '" class="confirm">删除</a>';
         table::row($column, 'select');
     }
     table::footer();
     page::add('</div>');
     form::buttons(array('type' => 'select', 'name' => 'operation', 'style' => 'width:180px', 'options' => array('optimize' => '优化', 'delete' => '删除'), 'value' => 'check'), array('type' => 'submit', 'value' => '执行操作'));
     form::footer();
     page::bottom();
     page::add('</div>');
     page::add('</div>');
     page::footer();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:64,代码来源:table.php

示例9: show

 public static function show(array $msg)
 {
     $page = new page();
     $page->set('msg', $msg);
     $message = $page->render('msg');
     if ($message !== false) {
         echo $message;
     } else {
         $page->title = $msg['type'];
         $page->body = array('class' => 'msg');
         $page->header();
         $page->add('');
         $page->add('<div id="icon"><div class="zotop-icon zotop-icon-' . $msg['type'] . '"></div></div>');
         $page->add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
         $page->add('	<div id="msg-type">' . $msg['type'] . '</div>');
         $page->add('	<div id="msg-life">' . (int) $msg['life'] . '</div>');
         $page->add('	<div id="msg-title">' . $msg['title'] . '</div>');
         $page->add('	<div id="msg-content">' . $msg['content'] . '</div>');
         $page->add('	<div id="msg-detail">' . $msg['detail'] . '</div>');
         $page->add('	<div id="msg-action">' . $msg['action'] . '</div>');
         $page->add('	<div id="msg-file">' . $msg['file'] . '</div>');
         $page->add('	<div id="msg-line">' . $msg['line'] . '</div>');
         if (!empty($msg['url'])) {
             $page->add('	<div>');
             $page->add('		<div><b>如果页面没有自动跳转,请点击以下链接</b></div>');
             $page->add('		<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
             $page->add('	</div>');
         }
         $page->add('</div>');
         $page->add('<div id="powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
         $page->footer();
     }
     exit;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:34,代码来源:msg.php

示例10: page

<?php

require_once '../thinkedit.init.php';
require_once '../class/datagrid.class.php';
require_once '../class/page.class.php';
$page = new page();
$datagrid = new datagrid();
$datagrid->addColumn('firstname', 'First name', true, true);
$datagrid->addColumn('lastname', 'Last name', true, true);
$datagrid->addColumn('title', 'Last name', true, true);
for ($i = 1; $i < 1000; $i++) {
    $data['firstname'] = rand(1, 100);
    $data['lastname'] = rand(1, 100);
    $data['title'] = rand(1, 100);
    $datagrid->add($data);
}
$page->startPanel('test');
$page->add($datagrid->render('icon'));
$page->endPanel('test');
echo $page->render();
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:20,代码来源:datagrid.test.php

示例11: onDefault

 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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:75,代码来源:index.php

示例12: browser

require_once 'init.inc.php';
require_once 'class/module.class.php';
require_once 'class/browser.class.php';
require_once 'class/page.class.php';
require_once 'class/url.class.php';
$browser = new browser();
$page = new page();
$url = new url();
if ($url->getParam('node')) {
    $node = $url->getParam('node');
} else {
    $node = 1;
}
$module = new module($node);
$page->startPanel('test');
$page->add($module->view());
$page->endPanel('test');
$page->startPanel('title');
$page->add('<h1>Welcome to Thinkedit 3.0</h1>');
$page->endPanel('title');
$page->addSeparator();
$page->startPanel('help');
$page->add('Navigate using icons bellow, use "up" to go up in the hierarchy');
$page->endPanel('help');
$page->addSeparator();
$page->startPanel('breadcrumb');
$parent = $module->getParent();
if ($parent) {
    $parent_link = new url();
    $parent_link->setParam('node', $parent->getNode());
    $page->add('<a href="' . $parent_link->render() . '">Up</a> ');
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:browser2.test.php

示例13: onDefault

 public function onDefault($tablename)
 {
     $tables = zotop::db()->tables(true);
     $table = $tables[$tablename];
     $fields = array();
     if (isset($table)) {
         $fields = zotop::db()->table($tablename)->fields(true);
     }
     $indexes = zotop::db()->table($tablename)->index();
     $page['title'] = '数据库管理 <i>></i> 数据表 [ <b>' . $tablename . '</b> ]  <h6>' . $table['comment'] . '</h6>';
     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($tablename), 'fields');
     form::header(array('class' => 'list'));
     $column = array();
     $column['select'] = html::checkbox(array('name' => 'id', 'class' => 'selectAll'));
     //$column['key w30 center'] = '索引';
     $column['name'] = '字段名称';
     $column['type w150'] = '字段类型';
     //$column['null w50'] = '空值';
     //$column['default w100'] = '默认值';
     //$column['comment'] = '注释';
     $column['manage pri'] = '主键';
     $column['manage index'] = '索引';
     $column['manage unique'] = '唯一';
     $column['manage fulltext'] = '全文';
     $column['manage edit'] = '修改';
     $column['manage delete'] = '删除';
     table::header('list', $column);
     foreach ($fields as $field) {
         $column = array();
         $column['select'] = html::checkbox(array('name' => 'id[]', 'class' => 'select'));
         //$column['key w30 center'] = '<span class="'.$field['key'].'">'.$field['key'].'</span>';
         $column['name'] = '<a href="' . zotop::url('database/field/edit', array('table' => $tablename, 'field' => $field['name'])) . '" title="注释:' . $field['comment'] . '&#13;默认:' . $field['default'] . '&#13;空值:' . $field['null'] . '&#13;整理:' . $field['collation'] . '"><b class="' . $field['key'] . '">' . $field['name'] . '</b></a><h5>' . $field['comment'] . '</h5>';
         $column['type w150'] = $field['type'] . (empty($field['length']) ? '' : '(' . $field['length'] . ')');
         //$column['null w50'] = $field['null'];
         //$column['default w100'] = $field['default'];
         //$column['comment'] = $field['comment'];
         $column['manage pri'] = '<a href="' . zotop::url('database/field/primaryKey', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要将该字段设置为主键?</h2>\'}">主键</a>';
         $column['manage index'] = '<a href="' . zotop::url('database/field/index', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要索引该字段?</h2>\'}">索引</a>';
         $column['manage unique'] = '<a href="' . zotop::url('database/field/unique', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要将该字段设置为唯一?</h2>\'}">唯一</a>';
         if (stripos((string) $field['type'], 'varchar') !== false || stripos((string) $field['type'], 'text') !== false) {
             $column['manage fulltext'] = '<a href="' . zotop::url('database/field/fulltext', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要将该字段设置为全文索引?</h2>\'}">全文</a>';
         } else {
             $column['manage fulltext'] = '<a class="disabled">全文</a>';
         }
         $column['manage edit'] = '<a href="' . zotop::url('database/field/edit', array('table' => $tablename, 'field' => $field['name'])) . '">修改</a>';
         $column['manage delete'] = '<a href="' . zotop::url('database/field/delete', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm">删除</a>';
         table::row($column, 'select');
     }
     table::footer();
     form::buttons(array('type' => 'submit', 'value' => '浏览选中项'));
     form::footer();
     page::bottom();
     page::add('</div>');
     page::add('</div>');
     page::add('<div id="side">');
     block::header('数据表信息');
     table::header();
     table::row(array('w60 bold' => '名称', '2' => '' . $table['name'] . ''));
     table::row(array('w60 bold' => '大小', '2' => '' . format::byte($table['size']) . ''));
     table::row(array('w60 bold' => '记录数', '2' => '<b>' . $table['rows'] . '</b> '));
     table::row(array('w60 bold' => '整理', '2' => '' . $table['collation'] . ''));
     table::row(array('w60 bold' => '创建时间', '2' => '' . $table['createtime'] . ''));
     table::row(array('w60 bold' => '更新时间', '2' => '' . $table['updatetime'] . ''));
     //table::row(array('w60 bold'=>'注释','2'=>''.$table['comment'].''));
     table::footer();
     block::footer();
     block::header('索引信息');
     $column = array();
     $column['i w10'] = '';
     $column['field'] = '字段';
     $column['type w30'] = '类型';
     $column['manage dropindex'] = '删除';
     table::header('list', $column);
     foreach ($indexes as $index) {
         $column = array();
         $column['i w10 center'] = '>';
         $column['field'] = '<b>' . $index['field'] . '</b>';
         $column['type w30'] = $index['type'];
         $column['manage dropindex'] = '<a href="' . url::build('database/field/dropindex', array('table' => $tablename, 'index' => $index['name'])) . '" class="confirm">删除</a>';
         table::row($column, 'select');
     }
     table::footer();
     block::footer();
     page::add('</div>');
     page::add('</div>');
     page::footer();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:92,代码来源:field.php

示例14: page

<?php

require_once 'init.inc.php';
require_once ROOT . '/class/page.class.php';
require_once ROOT . '/class/dropdown.class.php';
require_once ROOT . '/class/modulelist.class.php';
require_once ROOT . '/class/datagrid.class.php';
$page = new page();
$page->startPanel('title', 'title');
$page->add('Thinkedit 2.0');
$page->endPanel('title');
$module_selector = new dropdown();
$module_selector->setId('module_list');
$module_selector->setTitle('Choisissez un type d\'élément à éditer');
$modules = $thinkedit->getModuleList();
$module_selector->persist();
foreach ($modules as $module) {
    $module_selector->add($module, $module);
}
$page->startPanel('module_list');
$page->add($module_selector->render());
$page->endPanel('module_list');
if ($module_selector->getSelected()) {
    $list = new modulelist();
    $list->setType($module_selector->getSelected());
    $modules = $list->load();
    $datagrid = new datagrid();
    $datagrid->addColumn('id', 'Id');
    $datagrid->addColumn('title', 'Title');
    foreach ($modules as $module) {
        $datagrid->add($module->getArray());
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:list.php


注:本文中的page::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。