示例#1
0
 public function editAction($id, $type = '')
 {
     $config = zotop::model('zotop.config');
     $config->id = $id;
     if (form::isPostBack()) {
         $post = form::post();
         $post['settings'] = json_encode($post['settings']);
         $update = $config->update($post, $id);
         if ($update) {
             msg::success('保存成功,重新加载中,请稍后……', zotop::url('zotop/config/index', array('parentid' => $post['parentid'])));
         }
         msg::error(zotop::dump($post, true));
     }
     $field = $config->read();
     $field['settings'] = (array) json_decode($field['settings']);
     $type = empty($type) ? $field['type'] : $type;
     $field['type'] = $type;
     $page = new dialog();
     $page->set('title', '编辑');
     $page->set('body', array('style' => 'min-width:600px;'));
     $page->set('field', $field);
     $page->set('type', $type);
     $page->set('types', $config->types());
     $page->set('controls', $config->controls());
     $page->set('attrs', $config->attrs($type));
     $page->display();
 }
示例#2
0
文件: file.php 项目: dalinhuang/zotop
 public function actionEdit($id)
 {
     $file = zotop::model('system.file');
     $data = $file->read($id);
     $file->update(array('status' => 1), $id);
     zotop::dump($data);
 }
示例#3
0
 public function read($value, $key = '')
 {
     if (empty($key)) {
         $key = $this->getPrimaryKey();
     }
     /**/
     $sql = array('select' => '*', 'from' => $this->getTableName(), 'where' => array($key, '=', $value), 'limit' => 1);
     //$sql = "SELECT * FROM {$this->getTableName()} WHERE {$key}= '{$value}'";
     $read = $this->db->getRow($sql);
     zotop::dump($this->db->lastSql());
     return $read;
 }
示例#4
0
文件: main.php 项目: dalinhuang/zotop
 public function onDefault()
 {
     $header['title'] = '控制中心';
     page::header($header);
     page::top();
     page::navbar(array(array('id' => 'main', 'title' => '首页', 'href' => url::build('zotop/index/main')), array('id' => 'info', 'title' => '系统信息', 'href' => url::build('zotop/index/info'))), 'main');
     $db = zotop::db();
     $user = $db->select('*')->from('user')->orderby('id', 'asc')->limit(1)->getAll();
     zotop::dump($db->lastSql());
     zotop::dump($user);
     page::bottom('<span class="zotop-tip">最后一次登录时间:2009-8-9 14:17:54</span>');
     page::footer();
 }
示例#5
0
文件: file.php 项目: dalinhuang/zotop
 public function onEdit($file)
 {
     if (form::isPostBack()) {
         $content = request::post('source');
         msg::success('保存测试', '测试,继续编辑或者返回' . zotop::dump($content, true), 'reload');
     }
     $source = file::read(ROOT . $file);
     $page['title'] = '文件编辑器';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header(array('class' => 'sourceEditor'));
     form::field(array('type' => 'label', 'label' => zotop::t('文件名称'), 'name' => 'filename', 'value' => $file, 'valid' => '', 'description' => zotop::t('')));
     form::field(array('type' => 'source', 'label' => zotop::t('文件内容'), 'name' => 'source', 'value' => $source, 'valid' => 'required:true', 'description' => zotop::t('')));
     form::buttons(array('type' => 'submit', 'value' => '保存文件'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
示例#6
0
 public function parseOrderby($orderby)
 {
     $str = '';
     if (is_array($orderby)) {
         zotop::dump($orderby);
         foreach ($orderby as $key => $direction) {
             $direction = strtoupper(trim($direction));
             if (!in_array($direction, array('ASC', 'DESC', 'RAND()', 'RANDOM()', 'NULL'))) {
                 $direction = 'ASC';
             }
             $str .= ',' . $this->escapeColumn($key) . ' ' . $direction;
         }
     }
     return trim($str, ',');
 }
示例#7
0
 /**
  * 获取数据表的结构
  * 
  *
  */
 public function getTableStructure($flush = false)
 {
     static $table;
     $tableName = $this->getTableName(true);
     $tableFile = dirname(__FILE__);
     zotop::dump($tableFile);
 }
示例#8
0
文件: blog.php 项目: dalinhuang/zotop
 public static function info()
 {
     zotop::dump(dirname(dirname(dirname(__FILE__))) . DS . 'module.php');
 }
示例#9
0
 /**
  * 动作触发之前调用
  *
  */
 public function __before($arguments = '')
 {
     zotop::dump($arguments);
 }
示例#10
0
文件: file.php 项目: dalinhuang/zotop
 public function getList($where, $page = 1, $pagesize = 20)
 {
     zotop::dump($this->_user);
 }
示例#11
0
<?php

$this->header();
$this->top();
$this->navbar();
zotop::dump(zotop::user());
$this->bottom();
$this->footer();
示例#12
0
文件: html.php 项目: dalinhuang/zotop
 public static function link($href, $attrs = array())
 {
     $links = array();
     zotop::dump($href);
     $str = '';
     if (is_array($href)) {
         foreach ($href as $h) {
             $str .= html::link($h, $attrs);
         }
     } else {
         //使用绝对路径
         $href = url::abs($href);
         //一个页面只允许加载一次
         //if( isset($links[strtolower($href)]) )
         //{
         //   return '';
         //}
         $links[strtolower($href)] = true;
         $attrs['href'] = $href;
         $str = '<link' . html::attributes($attrs) . ' />';
     }
     return $str;
 }