本文整理汇总了PHP中commonModel类的典型用法代码示例。如果您正苦于以下问题:PHP commonModel类的具体用法?PHP commonModel怎么用?PHP commonModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了commonModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ajaxUpload
/**
* AJAX: the api to recive the file posted through ajax.
*
* @param string $uid
* @access public
* @return array
*/
public function ajaxUpload($uid)
{
if (RUN_MODE == 'front' and !commonModel::isAvailable('forum')) {
exit;
}
if (!$this->loadModel('file')->canUpload()) {
$this->send(array('error' => 1, 'message' => $this->lang->file->uploadForbidden));
}
$file = $this->file->getUpload('imgFile');
$file = $file[0];
if ($file) {
if (!$this->file->checkSavePath()) {
$this->send(array('error' => 1, 'message' => $this->lang->file->errorUnwritable));
}
if (!in_array(strtolower($file['extension']), $this->config->file->imageExtensions)) {
$this->send(array('error' => 1, 'message' => $this->lang->fail));
}
move_uploaded_file($file['tmpname'], $this->file->savePath . $file['pathname']);
if (in_array(strtolower($file['extension']), $this->config->file->imageExtensions) !== false) {
$this->file->compressImage($this->file->savePath . $file['pathname']);
$imageSize = $this->file->getImageSize($this->file->savePath . $file['pathname']);
$file['width'] = $imageSize['width'];
$file['height'] = $imageSize['height'];
}
$url = $this->file->webPath . $file['pathname'];
$file['addedBy'] = $this->app->user->account;
$file['addedDate'] = helper::now();
$file['editor'] = 1;
unset($file['tmpname']);
$this->dao->insert(TABLE_FILE)->data($file)->exec();
$_SESSION['album'][$uid][] = $this->dao->lastInsertID();
die(json_encode(array('error' => 0, 'url' => $url)));
}
}
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:41,代码来源:control.php
示例2: index
/**
* The index page of admin panel, print the sites.
*
* @access public
* @return void
*/
public function index()
{
$this->app->loadConfig('product');
$messages = new stdclass();
if (commonModel::isAvailable('forum')) {
$this->view->threads = $this->loadModel('thread')->getThreads();
$this->view->threadReply = $this->loadModel('reply')->getReplies();
}
if (commonModel::isAvailable('message')) {
$messages->comment = $this->loadModel('message')->getMessages('comment');
$messages->message = $this->loadModel('message')->getMessages('message');
$messages->reply = $this->loadModel('message')->getMessages('reply');
}
if (commonModel::isAvailable('order')) {
$this->view->orders = $this->loadModel('order')->getOrders();
}
if (commonModel::isAvailable('contribution')) {
$this->view->contributions = $this->loadModel('article')->getContributions();
}
$this->view->articleCategories = $this->loadModel('tree')->getOptionMenu('article', 0, $removeRoot = true);
$this->view->todayReport = $this->loadModel('stat')->getTodayReport();
$this->view->yestodayReport = $this->loadModel('stat')->getYestodayReport();
$this->view->ignoreUpgrade = isset($this->config->global->ignoreUpgrade) and $this->config->global->ignoreUpgrade;
$this->view->checkLocation = $this->loadModel('user')->checkAllowedLocation();
$this->view->currencySymbol = $this->config->product->currencySymbol;
$this->view->messages = $messages;
$this->display();
}
开发者ID:hansen1416,项目名称:eastsoft,代码行数:34,代码来源:control.php
示例3: createModuleMenu
public function createModuleMenu($method)
{
if (!isset($this->lang->my->{$method}->menu)) {
return false;
}
$string = "<nav id='menu'><ul class='nav'>\n";
/* Get menus of current module and current method. */
$moduleMenus = $this->lang->my->{$method}->menu;
$currentMethod = $this->app->getMethodName();
/* Cycling to print every menus of current module. */
foreach ($moduleMenus as $methodName => $methodMenu) {
/* Split the methodMenu to label, module, method, vars. */
list($label, $module, $method, $vars) = explode('|', $methodMenu);
$class = '';
if ($method == $currentMethod) {
$class = "class='active'";
}
$hasPriv = commonModel::hasPriv($module, $method);
if ($module == 'my' and $method == 'order') {
$hasPriv = commonModel::hasPriv('order', 'browse');
}
if ($module == 'my' and $method == 'contract') {
$hasPriv = commonModel::hasPriv('contract', 'browse');
}
if ($hasPriv) {
$string .= "<li {$class}>" . html::a(helper::createLink($module, $method, $vars), $label) . "</li>\n";
}
}
$string .= "</ul></nav>\n";
return $string;
}
开发者ID:leowh,项目名称:colla,代码行数:31,代码来源:model.php
示例4: sitemapXML
/**
* Output sitemap.xml.
*
* @access public
* @return void
*/
public function sitemapXML()
{
$this->loadModel('tree');
$this->loadModel('article');
$this->loadModel('product');
$this->loadModel('forum');
$this->loadModel('thread');
$bookAlias = $this->dao->select('id, alias')->from(TABLE_BOOK)->where('type')->eq('book')->fetchPairs('id', 'alias');
$nodes = $this->dao->select('id, title, type, path, alias, editedDate, addedDate')->from(TABLE_BOOK)->fetchAll();
$this->loadModel('book');
foreach ($nodes as $node) {
$bookID = $this->book->extractBookID($node->path);
$node->book = $bookAlias[$bookID];
}
$articles = $this->article->getList('article', $this->tree->getFamily(0, 'article'), 'id_desc');
$pages = $this->dao->select('id, title, alias')->from(TABLE_ARTICLE)->where('type')->eq('page')->andWhere('status')->eq('normal')->fetchAll('id');
$blogs = $this->article->getList('blog', $this->tree->getFamily(0, 'blog'), 'id_desc');
$products = $this->product->getList($this->tree->getFamily(0), 'id_desc');
$board = $this->tree->getFamily(0);
$threads = $this->dao->select('id, editedDate')->from(TABLE_THREAD)->beginIf($board)->where('board')->in($board)->orderBy('id desc')->fetchPairs();
$this->view->systemURL = commonModel::getSysURL();
$this->view->books = $nodes;
$this->view->articles = $articles;
$this->view->blogs = $blogs;
$this->view->products = $products;
$this->view->threads = $threads;
$this->view->pages = $pages;
$this->display();
}
开发者ID:peirancao,项目名称:chanzhieps,代码行数:35,代码来源:control.php
示例5: admin
/**
* Admin all blocks.
*
* @param int $index
* @access public
* @return void
*/
public function admin($index = 0)
{
$title = $index == 0 ? $this->lang->block->createBlock : $this->lang->block->editBlock;
$entries = $this->dao->select('*')->from(TABLE_ENTRY)->where('block')->ne('')->orWhere('buildin')->eq(1)->fetchAll('id');
if (!$index) {
$index = $this->block->getLastKey('sys') + 1;
}
$allEntries[''] = '';
foreach ($entries as $id => $entry) {
if (!commonModel::hasAppPriv($entry->code)) {
continue;
}
$allEntries[$entry->code] = $entry->name;
}
//$allEntries['rss'] = 'RSS';
$allEntries['html'] = 'HTML';
$allEntries['allEntries'] = $this->lang->block->allEntries;
$allEntries['dynamic'] = $this->lang->block->dynamic;
$hiddenBlocks = $this->block->getHiddenBlocks();
foreach ($hiddenBlocks as $block) {
$allEntries['hiddenBlock' . $block->id] = $block->title;
}
$this->view->block = $this->block->getBlock($index);
$this->view->entries = $entries;
$this->view->allEntries = $allEntries;
$this->view->index = $index;
$this->view->title = $title;
$this->display();
}
开发者ID:leowh,项目名称:colla,代码行数:36,代码来源:control.php
示例6: getAvailableBlocks
/**
* Get block list.
*
* @access public
* @return string
*/
public function getAvailableBlocks()
{
foreach ($this->lang->block->availableBlocks as $key => $block) {
if (!commonModel::hasPriv($key, 'browse')) {
unset($this->lang->block->availableBlocks->{$key});
}
}
return json_encode($this->lang->block->availableBlocks);
}
开发者ID:leowh,项目名称:colla,代码行数:15,代码来源:model.php
示例7: update
/**
* Update a product.
*
* @param int $productID
* @access public
* @return void
*/
public function update($productID)
{
$oldProduct = $this->getByID($productID);
$product = fixer::input('post')->add('editedBy', $this->app->user->account)->add('editedDate', helper::now())->get();
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()->batchCheck($this->config->product->require->edit, 'notempty')->where('id')->eq($productID)->exec();
if (dao::isError()) {
return false;
}
return commonModel::createChanges($oldProduct, $product);
}
开发者ID:leowh,项目名称:colla,代码行数:17,代码来源:model.php
示例8: getAvailableBlocks
/**
* Get block list.
*
* @access public
* @return string
*/
public function getAvailableBlocks()
{
foreach ($this->lang->block->availableBlocks as $key => $block) {
$module = $key == 'thread' ? 'forum' : $key;
$method = $key == 'thread' ? 'board' : 'index';
if (!commonModel::hasPriv($module, $method)) {
unset($this->lang->block->availableBlocks->{$key});
}
}
return json_encode($this->lang->block->availableBlocks);
}
开发者ID:leowh,项目名称:colla,代码行数:17,代码来源:model.php
示例9: getAvailableBlocks
/**
* Get block list.
*
* @access public
* @return string
*/
public function getAvailableBlocks()
{
foreach ($this->lang->block->availableBlocks as $key => $block) {
$method = $key == 'project' ? 'index' : 'browse';
if ($key == 'attend') {
$method = 'personal';
}
if (!commonModel::hasPriv($key, $method)) {
unset($this->lang->block->availableBlocks->{$key});
}
}
return json_encode($this->lang->block->availableBlocks);
}
开发者ID:leowh,项目名称:colla,代码行数:19,代码来源:model.php
示例10: getList
/**
* Get order list.
*
* @param string $mode
* @param mix $value
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getList($mode, $value, $orderBy = 'id_desc', $pager = null)
{
$days = $this->config->shop->confirmLimit;
if ($days) {
$deliveryDate = date('Y-m-d H:i:s', time() - 24 * 60 * 60 * $days);
$this->dao->update(TABLE_ORDER)->set('deliveryStatus')->eq('confirmed')->where('deliveryStatus')->eq('send')->andWhere('deliveriedDate')->le($deliveryDate)->exec();
}
$orders = $this->dao->select('*')->from(TABLE_ORDER)->beginIf($mode == 'account')->where('account')->eq($value)->fi()->beginIf($mode == 'status')->where('status')->eq($value)->fi()->beginIf(!commonModel::isAvailable('score'))->andWhere('type')->ne('score')->fi()->beginIf(!commonModel::isAvailable('shop'))->andWhere('type')->ne('shop')->fi()->orderBy($orderBy)->page($pager)->fetchAll('id');
$products = $this->dao->select('*')->from(TABLE_ORDER_PRODUCT)->where('orderID')->in(array_keys($orders))->fetchGroup('orderID');
foreach ($orders as $order) {
$order->products = isset($products[$order->id]) ? $products[$order->id] : array();
}
return $orders;
}
开发者ID:qiaqiali,项目名称:chanzhieps,代码行数:24,代码来源:model.php
示例11: admin
/**
* Nav admin function
*
* @param string $top
* @access public
* @return void
*/
public function admin($type = '')
{
if ($type == '' and $this->config->site->type == 'portal') {
$type = $this->device . '_top';
}
if ($type == '' and $this->config->site->type == 'blog') {
$type = $this->device . '_blog';
}
foreach ($this->lang->nav->system as $module => $name) {
if (!commonModel::isAvailable($module)) {
unset($this->lang->nav->system->{$module});
}
}
if ($_POST) {
$navs = $this->post->nav;
foreach ($navs as $key => $nav) {
$navs[$key] = $this->nav->organizeNav($nav);
}
if (isset($navs[2])) {
$navs[2] = $this->nav->group($navs[2]);
if (isset($navs[3])) {
$navs[3] = $this->nav->group($navs[3]);
}
foreach ($navs[2] as &$navList) {
foreach ($navList as &$nav) {
$nav['children'] = isset($navs[3][$nav['key']]) ? $navs[3][$nav['key']] : array();
}
}
}
foreach ($navs[1] as &$nav) {
$nav['children'] = isset($navs[2][$nav['key']]) ? $navs[2][$nav['key']] : array();
}
$settings = array($type => helper::jsonEncode($navs[1]));
$result = $this->loadModel('setting')->setItems('system.common.nav', $settings);
if ($result) {
$this->send(array('result' => 'success', 'message' => $this->lang->setSuccess));
}
$this->send(array('result' => 'fail', 'message' => $this->lang->failed));
}
$this->view->title = $this->lang->nav->setNav;
$this->view->navs = $this->nav->getNavs($type);
$this->view->type = $type;
$this->view->types = $this->lang->nav->types;
$this->view->articleTree = $this->loadModel('tree')->getOptionMenu('article');
$this->display();
}
开发者ID:hansen1416,项目名称:eastsoft,代码行数:53,代码来源:control.php
示例12: index
/**
* Output the rss.
*
* @access public
* @return void
*/
public function index()
{
$type = $this->get->type != false ? $this->get->type : 'blog';
$this->loadModel('tree');
$this->loadModel('article');
$this->app->loadClass('pager', $static = true);
$pager = new pager(0, isset($this->config->rss->items) ? $this->config->rss->items : 10, 1);
$articles = $this->article->getList($type, $this->tree->getFamily(0, $type), 'id_desc', $pager);
$latestArticle = current((array) $articles);
$this->view->title = $this->config->site->name;
$this->view->desc = $this->config->site->desc;
$this->view->siteLink = $this->inlink('browse', "type={$type}");
$this->view->siteLink = commonModel::getSysURL();
$this->view->articles = $articles;
$this->view->lastDate = $latestArticle ? $latestArticle->addedDate : date('Y-m-d H:i:s') . ' +0800';
$this->display();
}
开发者ID:jnan77,项目名称:chanzhieps,代码行数:23,代码来源:control.php
示例13:
</td>
<td><?php
echo $public->appID;
?>
</td>
<td>
<?php
commonModel::printLink('wechat', 'edit', "publicID={$public->id}", $lang->edit);
if (!$public->certified and $public->type == 'subscribe') {
echo html::a('javascript:;', $lang->wechat->setMenu, "class='text-muted' data-container='body' data-toggle='popover' data-placement='right' data-content='{$lang->wechat->needCertified}'");
} else {
commonModel::printLink('tree', 'browse', "type=wechat_{$public->id}", $lang->wechat->setMenu);
}
commonModel::printLink('wechat', 'adminResponse', "publicID={$public->id}", $lang->wechat->response->keywords);
commonModel::printLink('wechat', 'setResponse', "publicID={$public->id}&group=default&key=default", $lang->wechat->response->default, "data-toggle='modal'");
commonModel::printLink('wechat', 'setResponse', "publicID={$public->id}&group=subscribe&key=subscribe", $lang->wechat->response->subscribe, "data-toggle='modal'");
commonModel::printLink('wechat', 'delete', "publicID={$public->id}", $lang->delete, "class='deleter'");
commonModel::printLink('wechat', 'integrate', "publicID={$public->id}", $lang->wechat->integrate);
commonModel::printLink('wechat', 'qrcode', "publicID={$public->id}", $lang->wechat->qrcode, "data-toggle=modal");
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
include '../../common/view/footer.admin.html.php';
开发者ID:jnan77,项目名称:chanzhieps,代码行数:31,代码来源:admin.html.php
示例14:
?>
</td>
<td><?php
echo $log->desc;
?>
</td>
<td><?php
echo $log->browser;
?>
</td>
<td><?php
commonModel::printLink('user', 'adminlog', "ip={$log->ip}", $log->ip);
?>
</td>
<td><?php
commonModel::printLink('user', 'adminlog', "location={$log->location}", $log->location);
?>
</td>
<td><?php
echo $log->date;
?>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<td colspan='8'>
<?php
开发者ID:hansen1416,项目名称:eastsoft,代码行数:31,代码来源:adminlog.html.php
示例15: htmlspecialchars
</div>
</div>
<div class='form-group'>
<label class='col-md-2 control-label'><?php
echo $lang->category->desc;
?>
</label>
<div class='col-md-9'><?php
echo html::textarea('desc', htmlspecialchars($category->desc), "class='form-control' rows=3'");
?>
</div>
</div>
<div class='form-group'>
<label class='col-md-2 control-label'>图片</label>
<div class='col-md-9' style="padding-top:6px;"><?php
commonModel::printLink('file', 'browse', "objectType=category&objectID={$category->id}&isImage=1", '上传图片', "data-toggle='modal'");
?>
</div>
</div>
</div>
<div class='categoryInfo'>
<?php
if ($category->type == 'forum') {
?>
<div class='form-group'>
<label class='col-md-2 control-label'><?php
echo $lang->category->moderators;
?>
</label>
<div class='col-md-9'><?php
echo html::input('moderators', $category->moderators, "class='form-control' placeholder='{$lang->board->placeholder->moderators}'");
开发者ID:hansen1416,项目名称:eastsoft,代码行数:31,代码来源:edit.html.php
示例16: foreach
<td><?php
echo $order->id;
?>
</td>
<td class='text-left'><?php
echo $order->account;
?>
</td>
<td>
<dl>
<?php
foreach ($order->products as $product) {
?>
<dd class='text-left'>
<span><?php
echo html::a(commonModel::createFrontLink('product', 'view', "id={$product->productID}"), $product->productName, "target='_blank'");
?>
</span>
<span><?php
echo $lang->order->price . $lang->colon . $product->price . ' ' . $lang->order->count . $lang->colon . $product->count;
?>
</span>
</dd>
<?php
}
?>
</dl>
</td>
<td class='text-center'><?php
echo $order->amount;
?>
开发者ID:peirancao,项目名称:chanzhieps,代码行数:31,代码来源:admin.html.php
示例17: isonlybody
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chu Jilu <[email protected]>
* @package order
* @version $Id: sendmail.html.php 867 2010-06-17 09:32:58Z [email protected] $
* @link http://www.ranzhico.com
*/
$onlybody = isonlybody() ? true : false;
if ($onlybody) {
$_GET['onlybody'] = 'no';
}
?>
<table width='98%' align='center'>
<tr class='header'>
<td>
ORDER #<?php
echo $order->id . "=>{$order->assignedTo} " . html::a(commonModel::getSysURL() . $this->createLink('crm.order', 'view', "orderID={$order->id}"), $order->title);
?>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend><?php
echo $lang->order->view;
?>
</legend>
<div class='content'>
<?php
$productName = count($order->products) > 1 ? current($order->products) . $lang->etc : current($order->products);
?>
<p><?php
开发者ID:leowh,项目名称:colla,代码行数:31,代码来源:sendmail.html.php
示例18: browse
/**
* browse todos.
*
* @param string $mode
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function browse($mode = 'assignedTo', $orderBy = 'date_asc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->session->set('todoList', $this->app->getURI(true));
if ($mode == 'future') {
$todos = $this->todo->getList('self', $this->app->user->account, 'future', 'unclosed', $orderBy, $pager);
} else {
if ($mode == 'all') {
$todos = $this->todo->getList('self', $this->app->user->account, 'all', 'all', $orderBy, $pager);
} else {
if ($mode == 'undone') {
$todos = $this->todo->getList('self', $this->app->user->account, 'before', 'undone', $orderBy, $pager);
} else {
$todos = $this->todo->getList($mode, $this->app->user->account, 'all', 'unclosed', $orderBy, $pager);
}
}
}
$this->view->title = $this->lang->todo->browse;
$this->view->todos = $todos;
$this->view->users = $this->loadModel('user')->getPairs();
$this->view->mode = $mode;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->moduleMenu = commonModel::createModuleMenu($this->moduleName);
$this->display();
}
开发者ID:leowh,项目名称:colla,代码行数:38,代码来源:control.php
示例19:
?>
<?php
if (!empty($treeModuleMenu)) {
?>
<div class='col-md-2'>
<div class="leftmenu affix hiddden-xs hidden-sm">
<div class='panel category-nav'>
<div class='panel-body'>
<?php
echo $treeModuleMenu;
?>
<?php
if (!empty($treeManageLink)) {
?>
<div class='text-right'><?php
if (commonModel::hasPriv('tree', 'browse')) {
echo $treeManageLink;
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class='col-md-10'>
<?php
}
?>
开发者ID:jnan77,项目名称:chanzhieps,代码行数:31,代码来源:header.admin.html.php
示例20:
<?php
/**
* The browse view file of company module of chanzhiEPS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPLV12 (http://zpl.pub/page/zplv12.html)
* @author Xiying Guan <[email protected]>
* @package company
* @version $Id$
* @link http://www.chanzhi.org
*/
include '../../common/view/header.admin.html.php';
include '../../common/view/kindeditor.html.php';
js::set('score', commonModel::isAvailable('score'));
js::set('setCounts', $lang->site->setCounts);
$displayAll = $display === 'all';
?>
<div class='panel display-<?php
echo $display;
?>
'>
<div class='panel-heading'><strong><i class='icon-building'></i> <?php
echo $lang->company->setBasic;
?>
</strong></div>
<div class='panel-body'>
<form method='post' id='ajaxForm' class='ve-form'>
<table class='table table-form'>
<tr data-row='name'>
<th class='w-100px'><?php
开发者ID:wenyinos,项目名称:chanzhieps,代码行数:31,代码来源:setbasic.html.php
注:本文中的commonModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论