public function onDefault() { if (form::isPostBack()) { $post = array(); $post['username'] = request::post('username'); $post['password'] = request::post('password'); $post['logintime'] = time(); $user = zotop::model('zotop.user'); $data = $user->read($post['username'], 'username'); //zotop::dump($data); if ($data == false) { msg::error('登陆失败', zotop::t('账户名称`{$username}`不存在,请检查!', array('username' => $post['username']))); } zotop::user($data); msg::success('登陆成功', '登陆成功,系统正在加载中', 'reload', 2); } if (zotop::user() != null) { zotop::redirect('zotop/index'); } $header['title'] = '用户登录'; $header['js'] = url::module() . '/admin/js/login.js'; $header['body']['class'] = "login"; page::header($header); block::header(array('id' => 'LoginWindow', 'title' => '用户登录')); form::header(array('title' => '', 'description' => '请输入用户名和密码', 'class' => 'small')); form::field(array('type' => 'text', 'label' => zotop::t('帐 户(U)'), 'name' => 'username', 'value' => zotop::user('username'), 'valid' => 'required:true')); form::field(array('type' => 'password', 'label' => zotop::t('密 码(P)'), 'name' => 'password', 'value' => '')); form::buttons(array('type' => 'submit', 'value' => '登 陆'), array('type' => 'button', 'name' => 'options', 'value' => '选 项')); form::footer(); block::footer(); page::footer(); }
public function gui() { if ($this->status) { dcPage::success(__('Content successfully imported.')); } echo '<form action="' . $this->getURL(true) . '" method="post">' . '<p>' . sprintf(__('Add a feed content to the current blog: <strong>%s</strong>.'), html::escapeHTML($this->core->blog->name)) . '</p>' . '<p><label for="feed_url">' . __('Feed URL:') . '</label>' . form::field('feed_url', 50, 300, html::escapeHTML($this->feed_url)) . '</p>' . '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>'; }
public function onDefault() { if (form::isPostBack()) { msg::error('开发中', '数据保存开发中,请稍后……'); } $header['title'] = '系统设置'; page::header($header); page::top(); page::navbar($this->navbar(), 'main'); form::header(); block::header('网站基本信息'); form::field(array('type' => 'text', 'label' => zotop::t('网站名称'), 'name' => 'zotop.site.title', 'value' => zotop::config('zotop.site.title'), 'description' => zotop::t('网站名称,将显示在标题和导航中'))); form::field(array('type' => 'text', 'label' => zotop::t('网站域名'), 'name' => 'zotop.site.domain', 'value' => zotop::config('zotop.site.domain'), 'description' => zotop::t('网站域名地址,不包含http://,如:www.zotop.com'))); form::field(array('type' => 'text', 'label' => zotop::t('备案信息'), 'name' => 'zotop.site.icp', 'value' => zotop::config('zotop.site.icp'), 'description' => zotop::t('页面底部可以显示 ICP 备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空'))); form::field(array('type' => 'select', 'options' => array('0' => '不显示', '1' => '显示'), 'label' => zotop::t('授权信息'), 'name' => 'zotop.site.license', 'value' => zotop::config('zotop.site.license'), 'description' => zotop::t('页脚部位显示程序官方网站链接'))); form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => zotop::config('zotop.site.about'))); block::footer(); block::header('联系信息设置'); form::field(array('type' => 'text', 'label' => zotop::t('公司名称'), 'name' => 'zotop.site.title', 'value' => '', 'description' => zotop::t('网站隶属的公司或者组织名称'))); form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => '')); block::footer(); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); page::bottom(); page::footer(); }
public function add($id = '/') { $page = $this->page($id); $blueprint = blueprint::find($page); $templates = $blueprint->pages()->template(); $options = array(); $back = array('subpages' => purl('subpages/index/' . $page->id()), 'page' => purl($page, 'show')); $form = app::form('pages.add'); $form->save = l('add'); $form->back = a::get($back, get('to')); foreach ($templates as $template) { $options[$template->name()] = $template->title(); } $select = form::field('select', array('name' => 'template', 'label' => l('pages.add.template.label'), 'options' => $options, 'required' => true)); if ($templates->count() == 1) { $select->readonly = true; $select->value = $templates->first()->name(); } $form->fields()->append('template', $select); if (api::maxPages($page, $blueprint->pages()->max())) { $form->fields = array('info' => form::field('info', array('label' => 'pages.add.error.max.headline', 'text' => 'pages.add.error.max.text'))); $form->save = false; $form->centered = true; } return view('pages/add', array('page' => $page, 'form' => $form)); }
public function gui() { if ($this->status) { echo '<p class="message">' . __('Content successfully imported.') . '</p>'; } echo '<h3>' . __('Import from a feed') . '</h3>' . '<p>' . sprintf(__('This will import a feed (RSS or Atom) a as new content in the current blog: %s.'), '<strong>' . html::escapeHTML($this->core->blog->name) . '</strong>') . '</p>' . '<form action="' . $this->getURL(true) . '" method="post">' . '<fieldset>' . $this->core->formNonce() . form::hidden(array('do'), 1) . '<p><label>' . __('Feed URL:') . ' ' . form::field('feed_url', 40, 300, html::escapeHTML($this->feed_url)) . '</label></p>' . '<p><input type="submit" value="' . __('Send') . '" /></p>' . '</fieldset>' . '</form>'; }
function settingLine($id, $s, $ns, $field_name, $strong_label) { if ($s['type'] == 'boolean') { $field = form::combo(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $id), array(__('yes') => 1, __('no') => 0), $s['value']); } else { $field = form::field(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $id), 40, null, html::escapeHTML($s['value'])); } $slabel = $strong_label ? '<strong>%s</strong>' : '%s'; return '<tr>' . '<td><label for="s_' . $id . '">' . sprintf($slabel, html::escapeHTML($id)) . '</label></td>' . '<td>' . $field . '</td>' . '<td>' . $s['type'] . '</td>' . '<td>' . html::escapeHTML($s['label']) . '</td>' . '</tr>'; }
public function onSend() { $header['title'] = '发送短消息'; dialog::header($header); form::header(array('title' => '', 'description' => '请输入收信人的账户并输入短消息内容', 'class' => 'small')); form::field(array('type' => 'text', 'label' => zotop::t('收信人'), 'name' => 'sendto', 'value' => '', 'description' => '请输入收信人的账户名称,多个账户之间请用’逗号‘隔开')); form::field(array('type' => 'textarea', 'label' => zotop::t('内 容'), 'name' => 'content', 'value' => '')); form::buttons(array('type' => 'submit', 'value' => '发 送'), array('type' => 'button', 'name' => 'close', 'value' => '取消', 'class' => 'zotop-dialog-close')); form::footer(); dialog::footer(); }
public function actionAttrs($type = '') { if (empty($type)) { return false; } $field = zotop::model('system.config'); $attrs = $field->getControlAttrs($type); foreach ($attrs as $attr) { form::field($attr); } }
public static function item($attrs, $template = '') { $description = array_take('description', $attrs); $label = array_take('label', $attrs); $str = empty($template) ? form::template() : $template; $str = str_replace('{$field:label}', html::label($label, $attrs['name']), $str); $str = str_replace('{$field:required}', form::required($attrs['valid']), $str); $str = str_replace('{$field:description}', form::description($description), $str); $str = str_replace('{$field:controller}', form::field($attrs), $str); return $str; }
/** * Pager Links * * Returns pager links * * @return string */ public function getLinks() { $this->setURL(); $htmlFirst = $this->getLink("first", sprintf($this->page_url, 1), "images/pagination/first.png", "images/pagination/no-first.png", __('First page'), $this->env > 1); $htmlPrev = $this->getLink("prev", sprintf($this->page_url, $this->env - 1), "images/pagination/previous.png", "images/pagination/no-previous.png", __('Previous page'), $this->env > 1); $htmlNext = $this->getLink("next", sprintf($this->page_url, $this->env + 1), "images/pagination/next.png", "images/pagination/no-next.png", __('Next page'), $this->env < $this->nb_pages); $htmlLast = $this->getLink("last", sprintf($this->page_url, $this->nb_pages), "images/pagination/last.png", "images/pagination/no-last.png", __('Last page'), $this->env < $this->nb_pages); $htmlCurrent = '<li class="active"><strong>' . sprintf(__('Page %s / %s'), $this->env, $this->nb_pages) . '</strong></li>'; $htmlDirect = $this->nb_pages > 1 ? sprintf('<li class="direct-access">' . __('Direct access page %s'), form::field(array($this->var_page), 3, 10)) . '<input type="submit" value="' . __('ok') . '" class="reset" ' . 'name="ok" />' . $this->form_hidden . '</li>' : ''; $res = '<form action="' . $this->form_action . '" method="get">' . '<div class="pager"><ul>' . $htmlFirst . $htmlPrev . $htmlCurrent . $htmlNext . $htmlLast . $htmlDirect . '</ul>' . '</div>' . '</form>'; return $this->nb_elements > 0 ? $res : ''; }
public function onImage() { $header['title'] = '上传图片'; $header['js'][] = url::module() . '/admin/js/upload.js'; dialog::header($header); dialog::navbar($this->navbar(), 'upload'); form::header(array('title' => '', 'description' => '请选择本机图片并上传', 'class' => 'small')); form::field(array('type' => 'text', 'label' => zotop::t('图片地址'), 'name' => 'image', 'value' => 'http://www.baidu.com/logo.gif', 'description' => '请输入图片地址测试赋值')); form::field(array('type' => 'textarea', 'label' => zotop::t('图片说明'), 'name' => 'content', 'value' => '')); form::buttons(array('id' => 'UploadImages', 'type' => 'submit', 'value' => '上传图片'), array('type' => 'button', 'value' => zotop::t('取消'), 'class' => 'zotop-dialog-close')); form::footer(); dialog::footer(); }
public function content() { if (is_array($this->value())) { $timestamp = strtotime($this->result()); } else { $timestamp = strtotime($this->value()); } $date = form::field('date', array('name' => $this->name() . '[date]', 'value' => $timestamp ? date('Y-m-d', $timestamp) : null, 'format' => a::get($this->date, 'format', 'YYYY-MM-DD'), 'id' => 'form-field-' . $this->name() . '-date')); $time = form::field('time', array('name' => $this->name() . '[time]', 'value' => $timestamp ? date('H:i', $timestamp) : null, 'format' => a::get($this->time, 'format', 24), 'interval' => a::get($this->time, 'interval', 60), 'id' => 'form-field-' . $this->name() . '-time')); $grid = '<div class="field-grid">'; $grid .= '<div class="field-grid-item field-grid-item-1-2">' . $date->content() . '</div>'; $grid .= '<div class="field-grid-item field-grid-item-1-2">' . $time->content() . '</div>'; $grid .= '</div>'; return $grid; }
private function postLine($count, $checked) { $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; $sts_class = ''; switch ($this->rs->post_status) { case 1: $img_status = sprintf($img, __('Published'), 'check-on.png'); $sts_class = 'sts-online'; break; case 0: $img_status = sprintf($img, __('Unpublished'), 'check-off.png'); $sts_class = 'sts-offline'; break; case -1: $img_status = sprintf($img, __('Scheduled'), 'scheduled.png'); $sts_class = 'sts-scheduled'; break; case -2: $img_status = sprintf($img, __('Pending'), 'check-wrn.png'); $sts_class = 'sts-pending'; break; } $protected = ''; if ($this->rs->post_password) { $protected = sprintf($img, __('Protected'), 'locker.png'); } $selected = ''; if ($this->rs->post_selected) { $selected = sprintf($img, __('Hidden'), 'hidden.png'); } $attach = ''; $nb_media = $this->rs->countMedia(); if ($nb_media > 0) { $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments'); $attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png'); } $res = '<tr class="line ' . ($this->rs->post_status != 1 ? 'offline ' : '') . $sts_class . '"' . ' id="p' . $this->rs->post_id . '">'; $cols = array('position' => '<td class="nowrap handle minimal">' . form::field(array('order[' . $this->rs->post_id . ']'), 2, 3, $count + 1, 'position', '', false, 'title="' . sprintf(__('position of %s'), html::escapeHTML($this->rs->post_title)) . '"') . '</td>', 'check' => '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, $checked, '', '', !$this->rs->isEditable(), 'title="' . __('Select this page') . '"') . '</td>', 'title' => '<td class="maximal" scope="row"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>', 'date' => '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>', 'author' => '<td class="nowrap">' . $this->rs->user_id . '</td>', 'comments' => '<td class="nowrap count">' . $this->rs->nb_comment . '</td>', 'trackbacks' => '<td class="nowrap count">' . $this->rs->nb_trackback . '</td>', 'status' => '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>'); $cols = new ArrayObject($cols); $this->core->callBehavior('adminPagesListValue', $this->core, $this->rs, $cols); $res .= implode(iterator_to_array($cols)); $res .= '</tr>'; return $res; }
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(); }
public function content() { if (is_array($this->value())) { $timestamp = strtotime($this->result()); } else { $timestamp = strtotime($this->value()); } $dateDefault = a::get($this->date, 'default', $this->required() ? 'now' : false); $timeDefault = a::get($this->time, 'default', $this->required() ? 'now' : false); $dateValue = $timestamp ? date('Y-m-d', $timestamp) : $dateDefault; $timeValue = $timestamp ? date('H:i', $timestamp) : $timeDefault; $date = form::field('date', array('name' => $this->name() . '[date]', 'value' => $dateValue, 'format' => a::get($this->date, 'format', 'YYYY-MM-DD'), 'id' => 'form-field-' . $this->name() . '-date', 'required' => $this->required(), 'readonly' => $this->readonly(), 'disabled' => $this->disabled())); $time = form::field('time', array('name' => $this->name() . '[time]', 'value' => $timeValue, 'format' => a::get($this->time, 'format', 24), 'interval' => a::get($this->time, 'interval', 60), 'id' => 'form-field-' . $this->name() . '-time', 'required' => $this->required(), 'readonly' => $this->readonly(), 'disabled' => $this->disabled())); $grid = '<div class="field-grid">'; $grid .= '<div class="field-grid-item field-grid-item-1-2">' . $date->content() . '</div>'; $grid .= '<div class="field-grid-item field-grid-item-1-2">' . $time->content() . '</div>'; $grid .= '</div>'; return $grid; }
public function onDefault() { $header['title'] = '测试表单'; page::header($header); page::top(); page::navbar(array(array('id' => 'form', 'title' => '测试表单', 'href' => url::build('zotop/test')), array('id' => 'info', 'title' => '系统信息', 'href' => url::build('zotop/index/info'))), 'form'); form::header(); block::header(array('title' => '基本信息', 'action' => 'more')); form::field(array('type' => 'text', 'label' => '文本框', 'name' => 'test3', 'value' => '2的飞洒的发生地', 'valid' => '{required:true,maxlength:5}', 'description' => '提示信息')); form::field(array('type' => 'checkbox', 'label' => zotop::t('多选框'), 'name' => 'test1', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => array('1', '2'), 'valid' => '{required:true,minlength:3}', 'title' => '请最少选择三项', 'description' => '最少选择三项')); form::field(array('type' => 'checkbox', 'label' => zotop::t('多选框'), 'name' => 'test11', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a3', '4' => 'a4'), 'value' => array('1', '2', '4'), 'class' => 'block', 'valid' => '{required:true,maxlength:2}', 'title' => '最多选择2项', 'description' => '最多只允许选择2项')); form::field(array('type' => 'select', 'label' => '下拉列表', 'name' => 'test22', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => array('2', '4'), 'valid' => '{required:true,maxlength:1}', 'title' => '最多允许选择三项', 'description' => '提示信息')); form::field(array('type' => 'select', 'label' => '下拉列表', 'name' => 'test2', 'options' => array('' => 'empty', '1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => '2', 'valid' => '{required:true}', 'title' => '最多允许选择三项', 'description' => '提示信息')); block::footer(); block::header(array('title' => '高级信息', 'action' => 'more')); form::field(array('type' => 'image', 'label' => '上传图片', 'name' => 'test4', 'value' => '2的飞洒的发生地', 'valid' => 'required:true', 'description' => '提示信息')); form::field(array('type' => 'textarea', 'label' => '文本框', 'name' => 'test32', 'value' => '2的飞洒的发生地', 'valid' => 'required:true,maxlength:500', 'description' => '提示信息')); form::field(array('label' => '组合', 'type' => 'group', 'fields' => array(array('label' => '年', 'name' => 'year', 'type' => 'text'), array('label' => '月', 'name' => 'month', 'type' => 'text'), array('label' => '日', 'name' => 'day', 'type' => 'text')), 'description' => '生成一个复合控件')); block::footer(); form::buttons(array('type' => 'submit'), array('type' => 'reset')); form::footer(); page::bottom(); page::footer(); }
<style type="text/css"> </style> <?php form::header(); form::field(array('type' => 'hidden', 'name' => 'modelid', 'label' => '模型编号', 'value' => $data['modelid'], 'valid' => 'required:true', 'description' => '')); if ($data['system']) { form::field(array('type' => 'disabled', 'name' => 'name', 'label' => '字段名称', 'value' => $data['name'])); } else { form::field(array('type' => 'text', 'name' => 'name', 'label' => '字段名称', 'value' => $data['name'], 'valid' => '{required:true,maxlength:64,minlength:3}', 'description' => '只能由英文字母、数字和下划线组成,并且仅能字母开头,不以下划线结尾,如: <b>title</b>')); form::field(array('type' => 'hidden', 'name' => 'oname', 'label' => '字段名称', 'value' => $data['name'], 'valid' => '{required:true,maxlength:64,minlength:3}', 'description' => '只能由英文字母、数字和下划线组成,并且仅能字母开头,不以下划线结尾,如: <b>title</b>')); } form::field(array('type' => 'text', 'name' => 'label', 'label' => '控件标签', 'value' => $data['label'], 'valid' => '{required:true,maxlength:64}', 'description' => '请输入字段的标签,如:<b>新闻标题</b>')); if (!$data['system']) { form::field(array('type' => 'select', 'options' => $data['types'], 'name' => 'field', 'label' => '控件类型', 'value' => $data['field'], 'valid' => '{required:true}')); form::field('<div id="settings">'); foreach ($attrs as $t => $attr) { form::field($attr); } form::field('</div>'); } form::field(array('type' => 'css', 'name' => 'settings[class]', 'label' => '控件CSS', 'value' => $data['settings']['class'], 'valid' => '', 'description' => '定义表单的CSS样式名')); form::field(array('type' => 'css', 'name' => 'settings[style]', 'label' => '控件样式', 'value' => $data['settings']['style'], 'valid' => '', 'description' => '定义表单的style样式,如:width:200px;')); form::field(array('type' => 'text', 'name' => 'value', 'label' => '默认数值', 'value' => $data['value'], 'valid' => '', 'description' => '')); form::field(array('type' => 'select', 'options' => array(true => '不允许空值(NOT NULL)', false => '允许空值(NULL)'), 'name' => 'required', 'label' => '是否空值', 'value' => (int) $data['required'], 'valid' => '', 'description' => '')); form::field(array('type' => 'hidden', 'name' => 'system', 'label' => '系统字段', 'value' => (int) $data['system'], 'valid' => '', 'description' => '')); form::field(array('type' => 'valid', 'name' => 'valid', 'label' => '验证规则', 'value' => $data['valid'], 'valid' => '', 'description' => '字段值有效性验证规则,多个规则使用<b>英文逗号</b>隔开,如:<b>required:true,maxlength:200,email:true,url:true等</b>')); form::field(array('type' => 'text', 'name' => 'description', 'label' => '提示说明', 'value' => $data['description'], 'valid' => '', 'description' => '显示在控件下方作为表单输入提示')); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); $this->bottom(); $this->footer();
public function gui($url) { $blog =& $this->core->blog; $ak_key = $blog->settings->ak_key; $ak_verified = null; if (isset($_POST['ak_key'])) { try { $ak_key = $_POST['ak_key']; $blog->settings->setNameSpace('akismet'); $blog->settings->put('ak_key', $ak_key, 'string'); http::redirect($url . '&up=1'); } catch (Exception $e) { $this->core->error->add($e->getMessage()); } } if ($blog->settings->ak_key) { try { $ak = new akismet($blog->url, $blog->settings->ak_key); $ak_verified = $ak->verify(); } catch (Exception $e) { $this->core->error->add($e->getMessage()); } } $res = '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><label class="classic">' . __('Akismet API key:') . ' ' . form::field('ak_key', 12, 128, $ak_key) . '</label>'; if ($ak_verified !== null) { if ($ak_verified) { $res .= ' <img src="images/check-on.png" alt="" /> ' . __('API key verified'); } else { $res .= ' <img src="images/check-off.png" alt="" /> ' . __('API key not verified'); } } $res .= '</p>'; $res .= '<p><a href="http://wordpress.com/api-keys/">' . __('Get your own API key') . '</a></p>' . '<p><input type="submit" value="' . __('save') . '" />' . $this->core->formNonce() . '</p>' . '</form>'; return $res; }
<?php echo form::radio('graphic_lib', 'gd', $use_gd); ?> GD <?php echo form::radio('graphic_lib', 'im', $use_im); ?> Imagemagick </p> <p><label for="graphic_lib">Taille des miniatures:</label><br/> <?php echo form::field('thumb_width', 3, 3, $params['km_thumbwidth']); ?> * <?php echo form::field('thumb_height', 3, 3, $params['km_thumbheight']); ?> pixels </p> <p><label for="graphic_thumbtype">Type de miniatures:</label><br/> <?php echo form::combo('graphic_thumbtype', array('Echantillon' => 'crop', 'Redimensionnement' => 'redim'), $params['km_graphicthumbtype']); ?> </p> </fieldset><br/> <fieldset> <legend>Actions</legend> <? echo form::hidden('op','params');?> <? echo form::hidden('posted',1);?> <input type="submit" value="Enregistrer"/> <input type="reset" value="Annuler"/> </fieldset>
$core->blog->delComment($comment_id); http::redirect($core->getPostAdminURL($rs->post_type, $rs->post_id) . '&co=1#c' . $comment_id, false); } catch (Exception $e) { $core->error->add($e->getMessage()); } } if (!$can_edit) { $core->error->add(__("You can't edit this comment.")); } } /* DISPLAY -------------------------------------------------------- */ dcPage::open(__('Edit comment'), dcPage::jsConfirmClose('comment-form') . dcPage::jsToolBar() . dcPage::jsLoad('js/_comment.js')); if ($comment_id) { if (!empty($_GET['upd'])) { echo '<p class="message">' . __('Comment has been successfully updated.') . '</p>'; } $comment_mailto = ''; if ($comment_email) { $comment_mailto = '<a href="mailto:' . html::escapeHTML($comment_email) . '?subject=' . rawurlencode(sprintf(__('Your comment on my blog %s'), $core->blog->name)) . '&body=' . rawurlencode(sprintf(__("Hi!\n\nYou wrote a comment on:\n%s\n\n\n"), $rs->getPostURL())) . '">' . __('Send an e-mail') . '</a>'; } echo '<h2>' . html::escapeHTML($core->blog->name) . ' › ' . __('Edit comment') . '</h2>'; echo '<p><a class="back" href="' . $core->getPostAdminURL($post_type, $post_id) . '&co=1#c' . $comment_id . '"> ' . sprintf(__('Back to "%s"'), $post_title) . '</a></p>'; echo '<form action="comment.php" method="post" id="comment-form">' . '<p><label>' . __('IP address:') . '</label> ' . '<a href="comments.php?ip=' . $comment_ip . '">' . $comment_ip . '</a></p>' . '<p><label>' . __('Date:') . '</label> ' . dt::dt2str(__('%Y-%m-%d %H:%M'), $comment_dt) . '</p>' . '<p><label class="required" title="' . __('Required field') . '">' . __('Author:') . form::field('comment_author', 30, 255, html::escapeHTML($comment_author)) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($comment_email)) . $comment_mailto . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($comment_site)) . '</label></p>' . '<p><label>' . __('Status:') . form::combo('comment_status', $status_combo, $comment_status, '', '', !$can_publish) . '</label></p>' . $core->callBehavior('adminAfterCommentDesc', $rs) . '<p class="area"><label for="comment_content">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 10, html::escapeHTML($comment_content)) . '</p>' . '<p>' . form::hidden('id', $comment_id) . $core->formNonce() . '<input type="submit" accesskey="s" name="update" value="' . __('save') . '" /> '; if ($can_delete) { echo '<input type="submit" name="delete" value="' . __('delete') . '" />'; } echo '</p>' . '</form>'; } dcPage::helpBlock('core_comments'); dcPage::close();
</head> <body> <?php echo dcPage::breadcrumb(array(__('Plugins') => '', __('Pings configuration') => '')); echo '<form action="' . $p_url . '" method="post">' . '<p><label for="pings_active" class="classic">' . form::checkbox('pings_active', 1, $core->blog->settings->pings->pings_active) . __('Activate pings extension') . '</label></p>'; $i = 0; foreach ($pings_uris as $n => $u) { echo '<p><label for="pings_srv_name-' . $i . '" class="classic">' . __('Service name:') . '</label> ' . form::field(array('pings_srv_name[]', 'pings_srv_name-' . $i), 20, 128, html::escapeHTML($n)) . ' ' . '<label for="pings_srv_uri-' . $i . '" class="classic">' . __('Service URI:') . '</label> ' . form::field(array('pings_srv_uri[]', 'pings_srv_uri-' . $i), 40, 255, html::escapeHTML($u)); if (!empty($_GET['test'])) { try { pingsAPI::doPings($u, 'Example site', 'http://example.com'); echo ' <img src="images/check-on.png" alt="OK" />'; } catch (Exception $e) { echo ' <img src="images/check-off.png" alt="' . __('Error') . '" /> ' . $e->getMessage(); } } echo '</p>'; $i++; } echo '<p><label for="pings_srv_name2" class="classic">' . __('Service name:') . '</label> ' . form::field(array('pings_srv_name[]', 'pings_srv_name2'), 20, 128) . ' ' . '<label for="pings_srv_uri2" class="classic">' . __('Service URI:') . '</label> ' . form::field(array('pings_srv_uri[]', 'pings_srv_uri2'), 40, 255) . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $core->formNonce() . '</p>' . '</form>'; echo '<p><a class="button" href="' . $p_url . '&test=1">' . __('Test ping services') . '</a></p>'; ?> <?php dcPage::helpBlock('pings'); ?> </body> </html>
var url = $('input[name=file]').val(); var download = $('input[name=download]:checked').val(); if( download == 0 ){ callback(url); }else{ $('form.form').submit(); } }); }); //预览 $(function(){ preview($('#file').val()); }); $(function(){ $('#file').change(function(){ preview($(this).val()); }); }); </script> <div id="image-preview" style="margin:10px;text-align:center;height:260px;overflow:hidden;text-align:center;border:solid 1px #ebebeb;background:#fff;"> <div class="loader" style="line-height:260px;_margin-top:130px;">预览图片请先输入图片URL地址</div> </div > <?php form::header(); form::field(array('type' => 'text', 'label' => zotop::t('图片地址'), 'name' => 'file', 'value' => strtolower(substr($image, 0, 7)) == 'http://' ? $image : 'http://', 'description' => '请输入一个完整的图片地址,如:http://www.zotop.com/logo.png')); form::field(array('type' => 'radio', 'options' => array('1' => '将图片从远程自动上传到服务器', '0' => '不自动获取,直接插入图片地址'), 'label' => zotop::t('远程获取'), 'name' => 'download', 'value' => '0', 'class' => 'block', 'description' => '')); form::buttons(array('type' => 'button', 'value' => '插入图片', 'id' => 'insert'), array('type' => 'button', 'value' => zotop::t('取消'), 'class' => 'zotop-dialog-close')); form::footer(); $this->footer();
<?php $this->header(); //$this->top(); //$this->navbar(); form::header(); form::field(array('type' => 'hidden', 'name' => 'fieldname', 'label' => '字段名称', 'value' => $field['name'], 'valid' => '{required:true}')); form::field(array('type' => 'text', 'name' => 'name', 'label' => '字段名称', 'value' => $field['name'], 'valid' => '{required:true}', 'description' => '请输入字段的名称,3到32位,请勿使用特殊字符')); form::field(array('type' => 'text', 'name' => 'type', 'label' => '字段类型', 'value' => $field['type'], 'valid' => '{required:true}')); form::field(array('type' => 'text', 'name' => 'len', 'label' => '长度/值', 'value' => $field['length'], 'valid' => '{number:true,min:1}', 'description' => '请输入字段的长度,如果字段无须定义长度,请保持空值')); form::field(array('type' => 'hidden', 'name' => 'collation', 'label' => '整理', 'value' => $field['collation'], 'valid' => '', 'description' => '默认使用 <b>utf8_general_ci</b>: Unicode (多语言), 不区分大小写')); form::field(array('type' => 'select', 'options' => array('' => ' ', 'UNSIGNED' => 'UNSIGNED', 'UNSIGNED ZEROFILL' => 'UNSIGNED ZEROFILL', 'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP'), 'name' => 'attribute', 'label' => '属性', 'value' => $field['attribute'], 'valid' => '')); form::field(array('type' => 'select', 'options' => array('' => 'NULL', 'NOT NULL' => 'NOT NULL'), 'name' => 'null', 'label' => 'null', 'value' => $field['null'], 'valid' => '')); form::field(array('type' => 'text', 'name' => 'default', 'label' => '默认值', 'value' => $field['default'], 'valid' => '', 'description' => '如果需要可以为字段设置一个默认值')); form::field(array('type' => 'select', 'options' => array('' => '', 'AUTO_INCREMENT' => 'AUTO_INCREMENT'), 'name' => 'extra', 'label' => '额外', 'value' => $field['extra'], 'valid' => '', 'description' => '设置为自动增加:<b>AUTO_INCREMENT</b>时,该字段必须为数字类型')); form::field(array('type' => 'text', 'name' => 'comment', 'label' => '注释', 'value' => $field['comment'], 'valid' => '')); form::field(array('type' => 'select', 'name' => 'position', 'options' => $positions, 'label' => zotop::t('字段位置'), 'value' => $position, 'description' => '')); form::footer(array(array('type' => 'submit'), array('type' => 'button', 'value' => '关闭', 'class' => 'zotop-dialog-close'))); //$this->bottom(); $this->footer();
function form($searchString) { if (session::get("hyrarchy")) { echo "<div id='search' class='search'>"; } else { echo "<div id='searchbig' class='search'>"; } echo "<form method='GET' action='index.php' name='search'>"; echo "<b>Suche in</b><br>"; // Freie Suche if (!session::get("searchstart") and !session::get("searchexact")) { $checkString = " checked='checked'"; } else { $checkString = ""; } echo form::field("radio", "searchtype", 0, "", $checkString, "", "frei", "search-free"); // Suche am Wortanfang if (session::get("searchstart")) { $checkString = " checked='checked'"; } else { $checkString = ""; } echo form::field("radio", "searchtype", 1, "", $checkString, "", "Wortanfang", "search-start"); // exakte Suche if (session::get("searchexact")) { $checkString = " checked='checked'"; } else { $checkString = ""; } echo form::field("radio", "searchtype", 2, "", $checkString, "", "exact", "search-exact"); // search in comment field if (session::get("searchcom")) { $checkString = " checked='checked'"; } else { $checkString = ""; } echo form::field("checkbox", "searchcom", 1, "", $checkString, "", "Erläuterungen", "search-comment"); // search only for ordered entries // create array for selector $typeArray = thesaurus::get_type_list(); $statusArray = thesaurus::get_status_list(); $ownerArray = user::get_users("entry"); if (count($statusArray)) { echo "<br>"; echo form::selector("searchentrytype", $typeArray, 1, "", session::get("searchentrytype"), "", " Begriffstype ", "searchtype", ""); echo form::selector("searchstatus", $statusArray, 1, "", session::get("searchstatus"), "", " Status ", "searchstatus", ""); echo form::selector("searchowner", $ownerArray, 1, "", session::get("searchowner"), "", " Eigentümer mit Einträgen ", "searchowner", ""); } else { echo form::link("", "<span class='small'>Keine beantragten Einträge</span>", "", "no-ordered"); } // search field echo "<p><input type='text' size='35' name='searchString' value='" . session::get("search") . "' "; echo help::show("search-field", ""); echo ">"; echo form::field("submit", "action", "suchen", "", "", " ", "", "search"); echo form::field("submit", "reset", "zurücksetzen", "", "", " ", "", "newsearch"); echo "</form></p>"; echo "</div>"; }
public function input() { return form::field($this->name, $this->value, $this->type, true, $this->options); //??? }
<?php $this->header(); $this->top(); $this->navbar(); ?> <script type="text/javascript"> </script> <?php form::header(); form::field(array('type' => 'hidden', 'label' => zotop::t('分类编号'), 'name' => 'id', 'value' => $data['id'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'text', 'label' => zotop::t('分类标题'), 'name' => 'title', 'value' => $data['title'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'image', 'label' => zotop::t('分类图片'), 'name' => 'image', 'value' => $data['image'], 'description' => zotop::t(''))); form::field(array('type' => 'textarea', 'label' => zotop::t('分类说明'), 'name' => 'description', 'value' => $data['description'], 'description' => zotop::t(''))); form::field(array('type' => 'hidden', 'label' => zotop::t('分类排序'), 'name' => 'order', 'value' => $data['order'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::buttons(array('type' => 'submit', 'value' => '保存'), array('type' => 'button', 'value' => '关闭', 'class' => 'zotop-dialog-close')); form::footer(); $this->bottom(); $this->footer();
<?php $this->header(); $this->top(); $this->navbar(); echo html::msg('<h2>安全提示</h2><div>请不要使用过于简单的密码,如:111111、123456、生日密码、电话号码等,并及时的更换密码</div>'); form::header(); form::field(array('type' => 'disabled', 'label' => '账户名称', 'name' => 'username', 'value' => $user->username, 'valid' => '', 'description' => '')); form::field(array('type' => 'password', 'label' => '原密码', 'name' => 'password', 'value' => '', 'valid' => 'required:true', 'description' => '为确保安全,请输入你的密码')); form::field(array('type' => 'password', 'label' => '新密码', 'id' => 'newpassword', 'name' => 'newpassword', 'value' => '', 'valid' => 'required:true,minlength:6,maxlength:32', 'description' => '请输入您的新密码,6~32位之间')); form::field(array('type' => 'password', 'label' => '确认新密码', 'name' => 'newpassword2', 'value' => '', 'valid' => "required:true,equalTo:'#newpassword'", 'description' => '为确保安全,请再次输入您的新密码')); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); $this->bottom(); $this->footer();
"; href = href.replace(/__type__/i, type); $('#settings').load(href,function(){ }); }); }); </script> <style type="text/css"> body.dialog .form-body{height:450px;overflow:auto;} </style> <?php form::header(array('icon' => 'file', 'title' => '控件编辑', 'description' => '设置控件相关属性')); form::field(array('type' => 'hidden', 'name' => 'parentid', 'label' => '父节点编号', 'value' => $field['parentid'], 'valid' => '', 'description' => '')); form::field(array('type' => 'text', 'name' => 'id', 'label' => '节点键名', 'value' => $field['id'], 'valid' => '{required:true,maxlength:64,minlength:3}', 'description' => '3到64位,允许使用英文、数字,英文点号和下划线,请勿使用特殊字符')); form::field(array('type' => 'text', 'name' => 'title', 'label' => '节点名称', 'value' => $field['title'], 'valid' => '{required:true,maxlength:64}', 'description' => '请输入节点的标题名称')); form::field(array('type' => 'select', 'options' => $types, 'name' => 'type', 'label' => '控件类型', 'value' => $field['type'], 'valid' => '{required:true}')); form::field('<div id="settings">'); foreach ($attrs as $attr) { form::field($attr); } form::field('</div>'); form::field(array('type' => 'css', 'name' => 'settings[class]', 'label' => '控件CSS', 'value' => $field['settings']['class'], 'valid' => '', 'description' => '定义表单的CSS样式名')); form::field(array('type' => 'css', 'name' => 'settings[style]', 'label' => '控件样式', 'value' => $field['settings']['style'], 'valid' => '', 'description' => '定义表单的style样式,如:width:200px;')); form::field(array('type' => 'text', 'name' => 'value', 'label' => '默认数值', 'value' => $field['value'], 'valid' => '', 'description' => '')); form::field(array('type' => 'text', 'name' => 'valid', 'label' => '验证规则', 'value' => $field['valid'], 'valid' => '', 'description' => '节点值有效性验证规则,如:必选字段 <b>required:true,number:true</b>')); form::field(array('type' => 'text', 'name' => 'description', 'label' => '节点说明', 'value' => $field['description'], 'valid' => '', 'description' => '')); form::buttons(array('type' => 'submit', 'value' => '保 存'), array('type' => 'button', 'value' => '关 闭', 'class' => 'zotop-dialog-close')); form::footer(); //$this->bottom(); $this->footer();
if (!empty($_GET['upd'])) { dcPage::success(__('Selected comments have been successfully updated.')); } elseif (!empty($_GET['del'])) { dcPage::success(__('Selected comments have been successfully deleted.')); } if (!$core->error->flag()) { if (isset($_SESSION['comments_del_spam'])) { dcPage::message(__('Spam comments have been successfully deleted.')); unset($_SESSION['comments_del_spam']); } $spam_count = $core->blog->getComments(array('comment_status' => -2), true)->f(0); if ($spam_count > 0) { echo '<form action="' . $core->adminurl->get("admin.comments") . '" method="post" class="fieldset">'; if (!$with_spam || $status != -2) { if ($spam_count == 1) { echo '<p>' . sprintf(__('You have one spam comment.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show it.') . '</a></p>'; } elseif ($spam_count > 1) { echo '<p>' . sprintf(__('You have %s spam comments.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show them.') . '</a></p>'; } } echo '<p>' . $core->formNonce() . '<input name="delete_all_spam" class="delete" type="submit" value="' . __('Delete all spams') . '" /></p>'; # --BEHAVIOR-- adminCommentsSpamForm $core->callBehavior('adminCommentsSpamForm', $core); echo '</form>'; } echo '<form action="' . $core->adminurl->get("admin.comments") . '" method="get" id="filters-form">' . '<h3 class="hidden">' . __('Filter comments and trackbacks list') . '</h3>' . '<div class="table">' . '<div class="cell">' . '<h4>' . __('Filters') . '</h4>' . '<p><label for="type" class="ib">' . __('Type:') . '</label> ' . form::combo('type', $type_combo, $type) . '</p> ' . '<p><label for="status" class="ib">' . __('Status:') . '</label> ' . form::combo('status', $status_combo, $status) . '</p>' . '</div>' . '<div class="cell filters-sibling-cell">' . '<p><label for="author" class="ib">' . __('Author:') . '</label> ' . form::field('author', 20, 255, html::escapeHTML($author)) . '</p>' . '<p><label for="ip" class="ib">' . __('IP address:') . '</label> ' . form::field('ip', 20, 39, html::escapeHTML($ip)) . '</p>' . '</div>' . '<div class="cell filters-options">' . '<h4>' . __('Display options') . '</h4>' . '<p><label for="sortby" class="ib">' . __('Order by:') . '</label> ' . form::combo('sortby', $sortby_combo, $sortby) . '</p>' . '<p><label for="order" class="ib">' . __('Sort:') . '</label> ' . form::combo('order', $order_combo, $order) . '</p>' . '<p><span class="label ib">' . __('Show') . '</span> <label for="nb" class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('comments per page') . '</label></p>' . '</div>' . '</div>' . '<p><input type="submit" value="' . __('Apply filters and display options') . '" />' . '<br class="clear" /></p>' . '</form>'; # Show comments $comment_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.comments") . '" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected comments action:') . '</label> ' . form::combo('action', $comments_actions_page->getCombo(), $default, '', '', '', 'title="' . __('Actions') . '"') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden(array('type'), $type) . form::hidden(array('sortby'), $sortby) . form::hidden(array('order'), $order) . form::hidden(array('author'), html::escapeHTML(preg_replace('/%/', '%%', $author))) . form::hidden(array('status'), $status) . form::hidden(array('ip'), preg_replace('/%/', '%%', $ip)) . form::hidden(array('page'), $page) . form::hidden(array('nb'), $nb_per_page) . '</div>' . '</form>', $show_filters, $with_spam || $status == -2); } dcPage::helpBlock('core_comments'); dcPage::close();
}); </script> <style type="text/css"> body.dialog {width:700px;} body.dialog .form-body{height:400px;overflow:auto;} </style> <?php form::header(array('icon' => 'category', 'title' => zotop::t('新建栏目'), 'description' => zotop::t('新建一个栏目,并设置栏目的名称,模型及相关属性'))); box::header('基本信息'); form::field(array('type' => 'hidden', 'label' => zotop::t('栏目编号'), 'name' => 'id', 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'hidden', 'label' => zotop::t('上级栏目'), 'name' => 'parentid', 'value' => (int) $data['id'])); form::field(array('type' => 'disabled', 'label' => zotop::t('上级栏目'), 'name' => 'parent_name', 'value' => $data['title'])); form::field(array('type' => 'text', 'label' => zotop::t('栏目名称'), 'name' => 'title', 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'textarea', 'label' => zotop::t('栏目说明'), 'name' => 'description', 'description' => zotop::t(''))); form::field(array('type' => 'select', 'options' => array('' => zotop::t('请选择栏目模型')) + arr::hashmap($models, 'id', 'name'), 'label' => zotop::t('栏目模型'), 'name' => 'modelid', 'class' => 'box', 'valid' => 'required:true', 'value' => $data['modelid'])); box::footer(); box::header('模板设置'); form::field(array('type' => 'template', 'label' => zotop::t('首页模板'), 'name' => 'settings[template_index]', 'id' => 'template_index', 'value' => $data['settings']['template_index'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'template', 'label' => zotop::t('列表页面模板'), 'name' => 'settings[template_list]', 'value' => $data['settings']['template_list'], 'id' => 'template_list', 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'template', 'label' => zotop::t('详细页面模板'), 'name' => 'settings[template_detail]', 'id' => 'template_detail', 'value' => $data['settings']['template_detail'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'template', 'label' => zotop::t('打印页面模板'), 'name' => 'settings[template_print]', 'id' => 'template_print', 'value' => $data['settings']['template_print'], 'valid' => 'required:true', 'description' => zotop::t(''))); box::footer(); box::header('搜索优化'); form::field(array('type' => 'text', 'label' => zotop::t('栏目标题'), 'name' => 'settings[meta_title]', 'value' => $data['settings']['meta_title'], 'description' => zotop::t('针对搜索引擎设置的标题(meta title)'))); form::field(array('type' => 'text', 'label' => zotop::t('栏目关键词'), 'name' => 'settings[meta_keywords]', 'value' => $data['settings']['meta_keywords'], 'description' => zotop::t('针对搜索引擎设置的关键词(meta keywords)'))); form::field(array('type' => 'text', 'label' => zotop::t('栏目描述'), 'name' => 'settings[meta_description]', 'value' => $data['settings']['meta_description'], 'description' => zotop::t('针对搜索引擎设置的网页描述(meta description)'))); box::footer(); form::buttons(array('type' => 'submit', 'value' => '保存'), array('type' => 'button', 'value' => '关闭', 'class' => 'zotop-dialog-close')); form::footer(); $this->bottom(); $this->footer();