本文整理汇总了PHP中zotop::run方法的典型用法代码示例。如果您正苦于以下问题:PHP zotop::run方法的具体用法?PHP zotop::run怎么用?PHP zotop::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zotop
的用法示例。
在下文中一共展示了zotop::run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* 应用程序执行
*
*
* @return null
*/
public static function run()
{
$className = application::getControllerName();
$classPath = application::getControllerPath();
$method = application::getControllerMethod();
$arguments = router::arguments();
//加载controller
if (file_exists($classPath)) {
zotop::load($classPath);
} else {
zotop::run('system.404', array('filepath' => $classPath));
return false;
}
if (class_exists($className, false)) {
$controller = new $className();
if (method_exists($controller, $method) && $method[0] != '_') {
call_user_func_array(array($controller, '__before'), $arguments);
call_user_func_array(array($controller, $method), $arguments);
call_user_func_array(array($controller, '__after'), $arguments);
return true;
}
//当方法不存在时,默认调用类的_empty()函数,你可以在控制器中重写此方法
return call_user_func_array(array($controller, '__empty'), array($method, $arguments));
}
return false;
}
示例2: 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();
}
示例3: isValidUsername
public function isValidUsername($username)
{
if (empty($username)) {
return false;
}
//首先检查是否含有特殊字符
$badwords = array("\\", '&', ' ', "'", '"', '/', '*', ',', '<', '>', "\r", "\t", "\n", "#");
foreach ($badwords as $badword) {
if (strpos($username, $badword) !== false) {
return false;
}
}
//检查用户名是否有效
zotop::run('zotop.user.username.valid', $username);
return true;
}
示例4: deleteAction
public function deleteAction($id)
{
$user = zotop::model('zotop.user');
$usergroup = zotop::model('zotop.usergroup');
$usergroup->id = $id;
$usergroup->read();
if ($usergroup->id == 1) {
msg::error('超级管理员组无法被删除');
}
if ($user->countByGroupid($id) > 0) {
msg::error('该用户组下面尚有用户,无法被删除');
}
zotop::run('zotop.usergroup.delete', $usergroup);
if ($usergroup->delete()) {
$usergroup->cache();
msg::success('删除成功,正在重载数据,请稍后……', zotop::url('zotop/usergroup'));
}
}
示例5: delete
public function delete($where = array())
{
$modelcontent = zotop::model('content.modelcontent');
if (empty($where)) {
$where = array('id', '=', $this->id);
}
$data = $this->db()->select('id', 'modelid', 'globalid')->where($where)->getAll();
foreach ($data as $item) {
//删除模型内容数据
if ($item['modelid']) {
$modelcontent->modelid = $item['modelid'];
$modelcontent->delete();
}
//删除内容数据
parent::delete(array('id', '=', $item['id']));
//删除附件
//删除钩子,可以调用该钩子删除其他模块的相关数据
zotop::run('content.delete', $item['id']);
}
return true;
}
示例6: run
/**
* 应用程序执行
*
*
* @return null
*/
public static function run()
{
$classname = router::controllerName();
$filepath = router::controllerPath();
$method = router::controllerMethod();
$arguments = router::arguments();
//加载controller
if (file_exists($filepath)) {
zotop::load($filepath);
}
if (class_exists($classname, false)) {
$controller = new $classname();
if (method_exists($controller, $method) && $method[0] != '_') {
return call_user_func_array(array($controller, $method), $arguments);
} else {
//当方法不存在时,默认调用类的_empty()函数,你可以在控制器中重写此方法
return call_user_func_array(array($controller, '_empty'), $arguments);
}
}
zotop::run('system.404', array('filepath' => $filepath));
}
示例7:
echo zotop::url('system/login/logout');
?>
" id="logout" class="confirm {content:'<h1>您确定要退出登录?</h1><div>退出登陆后将默认将返回系统登录页面</div>',yes:'安全退出'}">安全退出</a>
</span>
</div>
<div id="navbar">
<ul>
<li><a href="javascript:void(0);" onclick="top.go('<?php
echo zotop::url('system/index/side');
?>
','<?php
echo zotop::url('system/index/main');
?>
')"><span>控制中心</span></a></li>
<?php
zotop::run('system.navbar');
?>
<li><a href="javascript:void(0);" onclick="top.go('<?php
echo zotop::url('system/file/side');
?>
','<?php
echo zotop::url('system/file/index');
?>
')"><span>文件管理</span></a></li>
<li><a href="javascript:void(0);" onclick="top.go('<?php
echo zotop::url('system/system/side');
?>
','<?php
echo zotop::url('system/system/index');
?>
')"><span>系统管理</span></a></li>
示例8: deleteAction
public function deleteAction($id)
{
$user = zotop::model('zotop.user');
$user->id = $id;
$user->read();
if ($user->id == 1 || $user->groupid === 0) {
msg::error('系统管理员无法被删除');
}
zotop::run('zotop.user.delete', $user);
if ($user->delete()) {
msg::success('删除成功,正在重载数据,请稍后……', zotop::url('zotop/user'));
}
}
示例9:
<?php
box::header(array('title' => '系统工具', 'icon' => '', 'class' => 'expanded'));
box::add('<ul class="list">');
box::add('<li><a href="' . zotop::url('system/setting') . '" target="mainIframe">系统设置</a></li>');
box::add('<li><a href="' . zotop::url('system/config') . '" target="mainIframe">注册表管理</a></li>');
box::add('<li><a href="' . zotop::url('system/module') . '" target="mainIframe">模块管理</a><span class="extra"><a href="' . zotop::url('zotop/module/uninstalled') . '" target="mainIframe">模块安装</a></span></li>');
zotop::run('zotop.system.side.tools');
box::add('</ul>');
box::footer();
?>
<?php
box::header(array('title' => '文件管理', 'icon' => '', 'class' => 'expanded'));
box::add('<ul class="list">');
box::add('<li><a href="' . zotop::url('system/file') . '" target="mainIframe">文件管理</a></li>');
box::add('<li><a href="' . zotop::url('system/file/add') . '" target="mainIframe">上传文件</a></li>');
box::add('</ul>');
box::footer();
zotop::run('zotop.system.side.file');
?>
<?php
box::header(array('title' => '系统用户', 'icon' => '', 'class' => 'expanded'));
box::add('<ul class="list">');
box::add('<li><a href="' . zotop::url('system/user') . '" target="mainIframe">系统用户管理</a></li>');
box::add('<li><a href="' . zotop::url('system/usergroup') . '" target="mainIframe">系统用户组管理</a></li>');
zotop::run('zotop.system.side.user');
box::add('</ul>');
box::footer();
$this->bottom();
$this->footer();
示例10:
?>
</div>
</div>
</div>
<div class="grid-m-s clearfix">
<div class="col-main">
<div class="col-main-inner">
<?php
zotop::run('system.main.main');
?>
</div>
</div>
<div class="col-sub">
<?php
zotop::run('system.main.side');
?>
<div class="box clearfix ">
<div class="box-header">
<h2>系统信息</h2>
<h3><a class="more" href="<?php
echo zotop::url('system/system/info');
?>
">详细</a></h3>
</div>
<div class="box-body clearfix">
<table class="table">
<tr><td class="w80">程序名称:</td><td><?php
echo zotop::config('zotop.name');
?>
</td></tr>
示例11:
<?php
$this->header();
?>
<?php
block::header(array('title' => '快捷操作', 'class' => 'expanded', 'icon' => '', 'action' => '<a href="#">管理</a>'));
block::add($modules);
block::footer();
block::header(array('title' => '我的信息', 'class' => 'expanded', 'icon' => ''));
block::add('<ul class="list">');
block::add('<li><a href="' . zotop::url('zotop/mine/changeinfo') . '" target="mainIframe">修改我的资料</a></li>');
block::add('<li><a href="' . zotop::url('zotop/mine/changepassword') . '" target="mainIframe">修改我的密码</a></li>');
zotop::run('zotop.index.side.mine');
block::add('</ul>');
block::footer();
$this->footer();
示例12: foreach
<ul>
<?php
foreach ($categorys as $c) {
?>
<li<?php
echo $categoryid == $c['id'] ? ' class="selected"' : '';
?>
><a class="textflow" href="<?php
echo zotop::url('blog/list/' . $c['id']);
?>
"><span class="zotop-icon zotop-icon-folder"></span><?php
echo $c['title'];
?>
</a></li>
<?php
}
?>
</ul>
</div>
<?php
box::footer();
?>
<?php
zotop::run('blog.side', $blog);
?>
</div>
</div>
</div>
<?php
$this->bottom();
$this->footer();
示例13:
?>
</div>
</div>
</div>
<div class="grid-m-s">
<div class="col-main">
<div class="col-main-inner">
<?php
zotop::run('zotop.main.main');
?>
</div>
</div>
<div class="col-sub">
<?php
zotop::run('zotop.main.side');
?>
<div class="block clearfix ">
<div class="block-header">
<h2>网站信息</h2>
<h3><a class="more" href="<?php
echo zotop::url('zotop/site/info');
?>
">详细</a></h3>
</div>
<div class="block-body clearfix">
<table class="table">
<tr>
<td class="w80">网站名称:</td><td><?php
echo zotop::config('site.name');
?>
示例14:
?>
" target="mainIframe">修改我的密码</a><b>|</b>
<a href="<?php
echo zotop::url('zotop/login/logout');
?>
" id="logout" class="confirm {content:'<h1>您确定要退出登录?</h1><div>退出登陆后将默认将返回系统登录页面</div>',yes:'安全退出'}">安全退出</a>
</span>
</div>
<div id="navbar">
<ul>
<li><a href="<?php
echo zotop::url('zotop/main/side');
?>
" target="sideIframe"><span>我的面板</span></a></li>
<?php
zotop::run('zotop.index.navbar');
?>
<li><a href="<?php
echo zotop::url('zotop/system/side');
?>
" target="sideIframe"><span>系统管理</span></a></li>
</ul>
</div>
<div id="favorate"><a href="<?php
echo zotop::url('zotop/favorate');
?>
" class="button ibutton dialog" title="打开收藏夹"><span class="button-icon zotop-icon zotop-icon-favorate"></span><span class="button-text">收藏夹</span></a></div>
</div>
</div>
<div id="position">
<div id="position-side">
示例15: execute
/**
* 应用程序执行
*
*
* @return null
*/
public static function execute()
{
if (zotop::module(application::module()) === null || (int) zotop::module(application::module(), 'status') < 0) {
msg::error(array('title' => '404 error', 'content' => zotop::t('<h2>未能找到模块,模块可能尚未安装或者已经被禁用?</h2>'), 'detail' => zotop::t('模块名称:{$module}', array('module' => application::$module))));
}
define('ZOTOP_MODULE', application::module());
define('ZOTOP_MODULE_PATH', zotop::module(application::module(), 'path'));
define('ZOTOP_MODULE_URL', zotop::module(application::module(), 'url'));
$controllerPath = ZOTOP_MODULE_PATH . DS . ZOTOP_APPLICATION . DS . application::controller() . '.php';
if (zotop::load($controllerPath)) {
} elseif (zotop::load(ZOTOP_MODULE_PATH . DS . ZOTOP_GROUP . DS . 'default.php')) {
$controllerPath = ZOTOP_MODULE_PATH . DS . ZOTOP_GROUP . DS . 'default.php';
application::$arguments = array_merge(array(application::$controller), array(application::$action), application::$arguments);
application::$controller = 'default';
application::$action = '';
} else {
zotop::error(array('title' => '404 error', 'content' => zotop::t('<h2>未能找到控制器,请检查控制器文件是否存在?</h2>'), 'detail' => zotop::t('文件名称:{$file}', array('file' => $controllerPath))));
}
define('ZOTOP_CONTROLLER', application::controller());
$class = application::module() . '_controller_' . application::controller();
if (class_exists($class, false)) {
//实例化控制器
$controller = new $class();
if (!method_exists($controller, 'action' . ucfirst(application::action()))) {
if (strlen(application::action()) > 0) {
application::$arguments = array_merge(array(application::$action), application::$arguments);
}
application::$action = $controller->action;
}
define('ZOTOP_ACTION', application::action());
if (method_exists($controller, 'action' . ucfirst(application::action()))) {
zotop::run("system.execute.before");
call_user_func_array(array($controller, 'action' . ucfirst(application::action())), application::arguments());
zotop::run("system.execute.after");
} else {
call_user_func_array(array($controller, '__empty'), array(application::action(), application::arguments()));
}
} else {
zotop::error(array('title' => '404 error', 'content' => zotop::t('<h2>未能找到控制器类,请检查控制器文件中是否存在控制器类?</h2>'), 'detail' => zotop::t('类名称:{$className}', array('className' => $class))));
}
}