本文整理汇总了PHP中zotop::filter方法的典型用法代码示例。如果您正苦于以下问题:PHP zotop::filter方法的具体用法?PHP zotop::filter怎么用?PHP zotop::filter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zotop
的用法示例。
在下文中一共展示了zotop::filter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smiles
/**
* 表情转换,可以通过hook(zotop.smiles)扩展
*
*
*/
public static function smiles($str)
{
$smiles = array(':)' => url::theme() . '/image/smiles/smile.gif', ':-)' => url::theme() . '/image/smiles/cool.gif');
$smiles = zotop::filter('zotop.smiles', $smiles);
foreach ($smiles as $key => $val) {
$str = str_replace($key, '<img src=' . $val . ' class="zotop-smile"/>', $str);
}
return $str;
}
示例2: login
/**
* 写入登陆信息
*
*/
public function login($data = array())
{
$data = array_merge($this->data, (array) $data);
$data = zotop::filter('zotop.user.login', $data);
//刷新信息
$this->refresh();
//记录用户数据
zotop::user($data);
return true;
}
示例3: login
/**
* 写入登陆信息
*
*/
public function login($data = array())
{
$data = array_merge($this->bind(), (array) $data);
$data = zotop::filter('zotop.user.login', $data);
//刷新信息
$this->refresh();
//记录用户数据
zotop::user($data);
zotop::log('login', zotop::t('用户 <b>{$username}</b> 于 {$time} 登陆成功', array('username' => $data['username'], 'time' => TIME)));
return true;
}
示例4: shutdown
/**
* 系统关闭,并输出渲染内容
*
* @return string
*/
public static function shutdown()
{
//获取页面内容
$contents = ob_get_contents();
//清理输出数据
ob_end_clean();
//渲染页面内容
$contents = zotop::filter('system.render', $contents);
//输入页面内容
echo $contents;
}
示例5: sideAction
public function sideAction()
{
$tools = array('reboot' => array('id' => 'reboot', 'title' => '系统重启', 'href' => zotop::url('zotop/system/reboot')), 'close' => array('id' => 'close', 'title' => '关闭网站', 'href' => zotop::url('zotop/system/close')), 'config' => array('id' => 'config', 'title' => '注册表管理', 'href' => zotop::url('zotop/config')));
$tools = zotop::filter('zotop.system.tools', $tools);
$users = array('user' => array('id' => 'reboot', 'title' => '系统用户管理', 'href' => zotop::url('zotop/user')), 'usergroup' => array('id' => 'close', 'title' => '系统用户组管理', 'href' => zotop::url('zotop/usergroup')));
$modules = array('list' => array('id' => 'list', 'title' => '模块列表', 'href' => zotop::url('zotop/module')), 'install' => array('id' => 'uninstalled', 'title' => '安装新模块', 'href' => zotop::url('zotop/module/uninstalled')));
$page = new side();
$page->title = '系统控制面板';
$page->set('tools', $page->navlist($tools));
$page->set('users', $page->navlist($users));
$page->set('modules', $page->navlist($modules));
$page->display();
}
示例6: build
/**
* 根据参数生成完整的URL,如:url::build('site://zotop/index/default/arg1/arg2',array('param1'=>'1'),'#top')
*
* @param string $uri 如:{application}://{module}/{controller}/{action}/{arg1}/arg2 组成
* @param array|string $params URL参数 ,一般为数组,也可以是字符串,如:param1/1/param2/2
* @param string $extra 额外数据:如锚点信息等
* @return string 如:/index.php/module/controller/action/arg1/arg2?param1=1¶m2=2#top
*/
public static function build($uri = '', $params = null, $extra = '')
{
$application = '';
if (strpos($uri, '://')) {
list($application, $uri) = explode('://', $uri);
}
//获取入口文件地址
if (empty($application)) {
$base = url::scriptname();
} else {
$base = zotop::application($application, 'url') . '/' . zotop::application($application, 'base');
$base = url::decode($base);
}
//uri处理
if ($u = explode('/', trim($uri, '/'))) {
//获取namespace 和 arguments
$namespace = array_slice($u, 0, 3);
$namespace = implode('/', $namespace);
$arguments = array_slice($u, 3);
//namespace切换
$namespace = zotop::filter('zotop.namespace', $namespace, &$arguments);
foreach ($arguments as $arg) {
$querystring .= '/' . $arg;
}
//querystring
$querystring = $namespace . $querystring;
$querystring = empty($querystring) ? '' : '/' . $uri;
$querystring .= empty($suffix) ? '' : $suffix;
}
//处理id/5/n/6 形式的参数
if (!is_array($params)) {
$args = explode('/', $params);
while ($key = array_shift($args)) {
$params[$key] = array_shift($args);
}
}
if (is_array($params) && !empty($params)) {
if (strpos($querystring, '?')) {
$querystring .= '&' . http_build_query($params);
} else {
$querystring .= '?' . http_build_query($params);
}
}
//组装url
$url = $base . $querystring . $extra;
$url = url::clean($url);
return $url;
}
示例7: execute
/**
* 解析URI
*
* URI 由模块名/控制器/动作/参数组成,采用如下的格式:
*
* @code php
* module/controller/action/param1/param2
* @endcode
*
*/
public static function execute()
{
$u = explode('/', trim(router::$uri, '/'));
//获取namespace 和 arguments
$namespace = implode('/', array_slice($u, 0, 3));
$arguments = array_slice($u, 3);
$namespace = zotop::filter('zotop.namespace', $namespace, &$arguments);
if ($namespace) {
list(router::$module, router::$controller, router::$action) = explode('/', $namespace);
}
//处理参数
for ($i = 0, $cnt = count($arguments); $i < $cnt; $i++) {
$arguments[$i] = rawurldecode($arguments[$i]);
}
router::$arguments = $arguments;
}
示例8: xheditor_rc1
function xheditor_rc1($attrs)
{
$attrs['class'] = isset($attrs['class']) ? 'editor ' . $attrs['class'] : 'editor';
$tools = array('image' => '<a href="' . zotop::url('system/image/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-imageuploader button-icon"></span><span class="button-text">插入图片</span></a>', 'file' => '<a href="' . zotop::url('system/file/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-fileuploader button-icon"></span><span class="button-text">插入文件</span></a>', 'template' => '<a href="' . zotop::url('system/file/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-template button-icon"></span><span class="button-text">插入模板</span></a>');
$tools = zotop::filter('editor.tools', $tools);
$tools = arr::take('tools', $attrs) === false ? array() : $tools;
$url = zotop::module('xheditor', 'url');
$html[] = html::script($url . '/editor/xheditor-zh-cn.min.js');
$html[] = html::script($url . '/common/global.js');
if (is_array($tools) && !empty($tools)) {
$html[] = '<div class="field-toolbar">';
foreach ($tools as $tool) {
$html[] = ' ' . $tool;
}
$html[] = '</div>';
}
$html[] = ' ' . field::textarea($attrs);
return implode("\n", $html);
}
示例9: controls
public function controls()
{
$controls = array();
$controls['folder']['name'] = '文件夹';
$controls['text']['name'] = '单行文本输入控件';
$controls['textarea']['name'] = '多行文本输入控件';
$controls['select']['name'] = '单选下拉控件';
$controls['select']['attr']['options'] = array('type' => 'textarea', 'label' => '控件选项', 'value' => '选项名称1|选项值1', 'description' => '每行一个,选项名称和选项值使用<b>|</b>隔开');
$controls['radio']['name'] = '单选按钮控件';
$controls['radio']['attr']['options'] = array('type' => 'textarea', 'label' => '控件选项', 'value' => '选项名称1|选项值1', 'description' => '每行一个,选项名称和选项值使用<b>|</b>隔开');
$controls['checkbox']['name'] = '复选框控件';
$controls['checkbox']['attr']['options'] = array('type' => 'textarea', 'label' => '控件选项', 'value' => '选项名称1|选项值1', 'description' => '每行一个,选项名称和选项值使用<b>|</b>隔开');
$controls['image']['name'] = '图片上传控件';
$controls['image']['attr']['upload'] = array('type' => 'radio', 'label' => '图片上传', 'options' => array(true => '允许上传', false => '不允许上传'));
$controls['editor']['name'] = '富文本编辑器';
$controls['editor']['attr']['toolbar'] = array('type' => 'radio', 'label' => '编辑器类型', 'options' => array('basic' => '简洁型', 'standard' => '标准型', 'full' => '全功能型'), 'value' => 'standard');
$controls = zotop::filter('config.controls', $controls);
return $controls;
}
示例10: navbar
public function navbar()
{
$navbar = array('index' => array('id' => 'index', 'title' => '模型列表', 'href' => zotop::url('content/model')), 'add' => array('id' => 'add', 'title' => '添加模型', 'href' => zotop::url('content/model/add')), 'edit' => array('id' => 'edit', 'title' => '编辑模型', 'href' => ''));
$navbar = zotop::filter('content.model.navbar', $navbar);
return $navbar;
}
示例11: controls
public function controls()
{
$controls = array('width' => array('type' => 'text', 'name' => 'settings[width]', 'label' => '控件宽度', 'value' => '', 'valid' => '', 'description' => '控件的宽度,单位为<b>px</b>'), 'height' => array('type' => 'text', 'name' => 'settings[height]', 'label' => '控件高度', 'value' => '', 'valid' => '', 'description' => '控件的高度,单位为<b>px</b>'), 'style' => array('type' => 'text', 'name' => 'settings[style]', 'label' => '控件样式', 'value' => '', 'valid' => '', 'description' => '控件的style属性'), 'class' => array('type' => 'text', 'name' => 'settings[class]', 'label' => '控件风格', 'value' => '', 'valid' => '', 'description' => '控件的class属性'), 'options' => array('type' => 'textarea', 'name' => 'settings[options]', 'label' => '控件选项', 'value' => '选项名称1|选项值1', 'valid' => '', 'description' => '每行一个,值和数据使用<b> | </b>隔开'), 'upload' => array('type' => 'radio', 'name' => 'settings[upload]', 'options' => array('1' => '允许上传', '0' => '不允许上传'), 'label' => '上传设置', 'value' => '0', 'valid' => ''));
$controls = zotop::filter('zotop.config.field.controls', $controls);
return $controls;
}
示例12: update
/**
* 更新数据
*
* @param mix $data 待更新的数据
* @param mix $where 条件
*
* @return array
*/
public function update($data = array(), $where = '')
{
$data = empty($data) ? $this->bind() : $data;
$data = zotop::filter($this->table() . '.update', $data, $where);
$data = $this->_check_data($data);
if (!is_array($where)) {
$key = $this->key();
if (empty($where)) {
if (isset($data[$key])) {
$where = array($key, '=', $data[$key]);
} else {
$where = array($key, '=', $this->{$key});
}
}
if (is_numeric($where) || is_string($where)) {
$where = array($key, '=', $where);
}
}
if (is_array($data) && !empty($data) && !$this->error()) {
$update = $this->db()->set($data)->where($where)->update();
}
unset($data);
return $update;
}
示例13: navbar
public function navbar($categoryid = 0)
{
$navbar = array('index' => array('id' => 'index', 'title' => zotop::t('内容列表'), 'href' => zotop::url("content/content/index/{$categoryid}")), 'add' => array('id' => 'add', 'title' => zotop::t('添加内容'), 'href' => zotop::url("content/content/add/{$categoryid}")), 'edit' => array('id' => 'edit', 'title' => zotop::t('编辑内容')), 'category' => array('id' => 'category', 'title' => zotop::t('栏目设置'), 'href' => zotop::url("content/category/edit/{$categoryid}"), 'class' => 'dialog'));
$navbar = zotop::filter('content.content.navbar', $navbar);
return $navbar;
}
示例14: navbar
public function navbar()
{
$navbar = array('index' => array('id' => 'index', 'title' => '首 页', 'href' => zotop::url('content')), 'setting' => array('id' => 'setting', 'title' => '模块设置', 'href' => zotop::url('content/setting')));
$navbar = zotop::filter('content.index.navbar', $navbar);
return $navbar;
}
示例15: status
public function status()
{
$status = array('100' => zotop::t('通过审核并发布'), '0' => zotop::t('等待审核'), '-1' => zotop::t('未通过审核'), '-50' => zotop::t('草稿'));
$status = zotop::filter($this->table() . '.status', $status);
return $status;
}