本文整理汇总了PHP中zotop::modules方法的典型用法代码示例。如果您正苦于以下问题:PHP zotop::modules方法的具体用法?PHP zotop::modules怎么用?PHP zotop::modules使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zotop
的用法示例。
在下文中一共展示了zotop::modules方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSide
public function actionSide()
{
$m = array();
$modules = (array) zotop::modules();
foreach ($modules as $module) {
if ($module['type'] == 'com') {
$module['href'] = zotop::url($module['id']);
$m[$module['id']] = $module;
}
}
$page = new side();
$page->set('modules', $page->navlist($m));
$page->display();
}
示例2: actionSide
public function actionSide()
{
$modules = (array) zotop::modules();
foreach ($modules as $id => $module) {
if ($module['type'] != 'com') {
unset($modules[$id]);
} else {
$modules[$id]['href'] = zotop::url($module['id']);
}
}
$page = new side();
$page->title = '系统控制面板';
$page->set('modules', $modules);
$page->display();
}
示例3: xheditor
function xheditor($attrs)
{
$attrs['class'] = isset($attrs['class']) ? 'editor ' . $attrs['class'] : 'editor';
$tools = array('image' => '<a href="' . zotop::url('zotop/image/upload', array('globalid' => form::globalid(), 'field' => $attrs['name'], 'image' => '__image__')) . '" class="button editor-insert" name="' . $attrs['name'] . '" type="image"><span class="zotop-icon zotop-icon-imageuploader button-icon"></span><span class="button-text">插入本地图片</span></a>', 'file' => '<a href="' . zotop::url('zotop/file/upload', array('globalid' => form::globalid(), 'field' => $attrs['name'], 'image' => '__file__')) . '" class="button editor-insert" name="' . $attrs['name'] . '" type="file"><span class="zotop-icon zotop-icon-fileuploader button-icon"></span><span class="button-text">插入本地文件</span></a>', 'template' => '<a href="' . zotop::url('zotop/file/upload', array('globalid' => form::globalid(), 'field' => $attrs['name'], 'image' => '__file__')) . '" class="button editor-insert" name="' . $attrs['name'] . '" type="template"><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::modules('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[] = '<div class="field-wrapper">';
$html[] = ' ' . field::textarea($attrs);
$html[] = '</div>';
return implode("\n", $html);
}
示例4: execute
/**
* 应用程序执行
*
*
* @return null
*/
public static function execute()
{
if (zotop::modules(ZOTOP_MODULE) === null || (int) zotop::modules(ZOTOP_MODULE, 'status') < 0) {
msg::error(array('title' => '404 error', 'content' => zotop::t('<h2>未能找到模块,模块可能尚未安装或者已经被禁用?</h2>'), 'detail' => zotop::t('模块名称:{$module}', array('module' => ZOTOP_MODULE))));
}
//controller classname
$controllerName = ZOTOP_MODULE . '_controller_' . ZOTOP_CONTROLLER;
$controllerPath = ZOTOP_MODULE_PATH . DS . ZOTOP_GROUP . DS . ZOTOP_CONTROLLER . '.php';
if (!class_exists($controllerName, false)) {
if (!zotop::load($controllerPath)) {
msg::error(array('title' => '404 error', 'content' => zotop::t('<h2>未能找到控制器,请检查控制器文件是否存在?</h2>'), 'detail' => zotop::t('文件名称:{$file}', array('file' => $controllerPath))));
}
}
if (class_exists($controllerName, false)) {
//实例化控制器
$controller = new $controllerName();
//调用__execute方法
$controller->execute(ZOTOP_ACTION, application::arguments());
} else {
msg::error(array('title' => '404 error', 'content' => zotop::t('<h2>未能找到控制器类,请检查控制器文件中是否存在控制器类?</h2>'), 'detail' => zotop::t('类名称:{$className}', array('className' => $controllerName))));
}
}
示例5: model
/**
* 用于实例化一个模型{module}.{model},如 zotop.user,实例化系统模块的user模型
*
*
* @param $name 模型名称空间
* @return object(model)
*/
public static function model($name = '')
{
static $models = array();
if (empty($name)) {
return new model();
}
if (isset($models[$name])) {
return $models[$name];
}
list($module, $model) = explode('.', $name);
$modelName = $module . '_model_' . $model;
if (!class_exists($modelName)) {
$modelPath = zotop::modules($module, 'path') . DS . 'models' . DS . $model . '.php';
if (zotop::load($modelPath) == false) {
zotop::error(array('content' => zotop::t('请检查相应的模型文件是否存在'), 'detail' => zotop::t('文件地址:{$modelPath}', array('modelPath' => $modelPath))));
}
}
if (class_exists($modelName)) {
$m = new $modelName();
$models[$name] = $m;
return $m;
}
zotop::error(array('content' => zotop::t('请检查相应的模型文件中是否存在模型类 :{$modelName}', array('modelPath' => $modelPath, 'modelName' => $modelName)), 'detail' => zotop::t('文件地址:{$modelPath}', array('modelPath' => $modelPath, 'modelName' => $modelName))));
}
示例6:
block::footer();
?>
<?php
block::header(array('title' => zotop::modules('blog', 'name')));
?>
<table class="table">
<tr><td><?php
echo zotop::modules('blog', 'description');
?>
</td></tr>
<tr><td>版本:<?php
echo zotop::modules('blog', 'version');
?>
</td></tr>
<tr><td>作者:<?php
echo zotop::modules('blog', 'author');
?>
</td></tr>
<tr><td>主页:<?php
echo html::a(zotop::modules('blog', 'homepage'));
?>
</td></tr>
</table>
<?php
block::footer();
?>
<?php
$this->sideFooter();
$this->footer();