Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 public static function header($form = array())
 {
     if (isset($form['template'])) {
         form::$template = arr::take('template', $form);
     }
     $attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
     $attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
     $attrs['action'] = isset($form['action']) ? $form['action'] : url::current();
     //加载表头
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     //加载常用js
     $html[] = html::script(url::common() . '/js/jquery.validate.js');
     $html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
     $html[] = html::script(url::common() . '/js/jquery.form.js');
     //表单头部
     if (isset($form['title']) || isset($form['description'])) {
         $html[] = '<div class="form-header clearfix">';
         $html[] = isset($form['icon']) ? '		<div class="form-icon"></div>' : '';
         $html[] = isset($form['title']) ? '		<div class="form-title">' . $form['title'] . '</div>' : '';
         $html[] = isset($form['description']) ? '		<div class="form-description">' . $form['description'] . '</div>' : '';
         $html[] = '</div>';
     }
     //表单body部分开始
     $html[] = '<div class="form-body">';
     echo implode("\n", $html);
 }
Exemplo n.º 3
0
 public static function source($attrs)
 {
     $html = array();
     $html[] = '';
     $html[] = '<div style="height:460px;overflow:hidden;">';
     $html[] = '<div id="SourceEditorPannel">正在加载编辑器,请稍后……</div>';
     $html[] = html::script(url::common() . '/js/swfobject.js');
     $html[] = html::script(url::module() . '/admin/js/file.js');
     $html[] = field::textarea($attrs);
     $html[] = '</div>';
     return implode("\n", $html);
 }
Exemplo n.º 4
0
 public static function header($header = array())
 {
     if (isset($header['template'])) {
         form::$template = arr::take('template', $header);
     }
     $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['description']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = html::script(url::common() . '/js/jquery.validate.js');
     $html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
     $html[] = html::script(url::common() . '/js/jquery.form.js');
     $html[] = html::script(url::common() . '/js/zotop.form.js');
     echo implode("\n", $html);
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
0
 /**
  * 图片上传输入框
  *
  * @param $attrs array 控件参数
  * @return string 控件代码
  */
 public static function image($attrs)
 {
     $attrs['handle'] = empty($attrs['handle']) ? zotop::url('zotop/upload/image') : $attrs['handle'];
     $html[] = html::script(url::common() . '/js/zotop.upload.js');
     $html[] = '<div class="field-inner inline-block">';
     $html[] = '	' . field::text($attrs);
     $html[] = '	' . html::input(array('type' => 'button', 'class' => 'upload-image', 'title' => zotop::t('上传图片')));
     $html[] = '</div>';
     return implode("\n", $html);
 }
Exemplo n.º 7
0
 public static function script($files)
 {
     $default['jquery'] = url::common() . '/js/jquery.js';
     $default['plugins'] = url::common() . '/js/jquery.plugins.js';
     $default['zotop'] = url::common() . '/js/zotop.js';
     //用户的meta
     $files = array_merge($default, (array) $files);
     foreach ($files as $file) {
         $html[] = '	' . html::script($file);
     }
     return implode("\n", $html);
 }
Exemplo n.º 8
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;
 }
Exemplo n.º 9
0
 public static function header($header = array())
 {
     $header['js']['dialog'] = url::common() . '/js/zotop.dialog.js';
     $header['body']['class'] = 'dialog';
     parent::header($header);
 }