當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。