/** * show notify in msgBox. * * @access public * @return string */ public function notify() { $messages = $this->dao->select('COUNT(*) as count')->from(TABLE_MESSAGE)->where('`to`')->eq($this->app->user->account)->andWhere('readed')->eq(0)->fetch('count'); if ($messages) { echo html::a(helper::createLink('user', 'message'), sprintf($this->lang->user->message->mine, $messages)); } }
/** * links profile. * * @access public * @return void */ public function index() { $this->view->links = $this->config->links; $this->view->mobileURL = helper::createLink('links', 'index', '', '', 'mhtml'); $this->view->desktopURL = helper::createLink('links', 'index', '', '', 'html'); $this->display(); }
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; }
/** * The board page. * * @param int $boardID the board id * @param int $pageID the current page id * @access public * @return void */ public function board($boardID = 0, $pageID = 1) { $board = $this->loadModel('tree')->getByID($boardID, 'forum'); if (!$board) { die(js::locate('back')); } if ($board->link) { helper::header301($board->link); } /* Get common threads. */ $recPerPage = !empty($this->config->site->forumRec) ? $this->config->site->forumRec : $this->config->forum->recPerPage; $this->app->loadClass('pager', $static = true); $pager = new pager(0, $recPerPage, $pageID); $threads = $this->loadModel('thread')->getList($board->id, $orderBy = 'repliedDate_desc', $pager); $this->view->title = $board->name; $this->view->keywords = $board->keywords . '' . $this->config->site->keywords; $this->view->desc = strip_tags($board->desc); $this->view->board = $board; $this->view->sticks = $this->thread->getSticks($board->id); $this->view->threads = $threads; $this->view->pager = $pager; $this->view->mobileURL = helper::createLink('forum', 'board', "borderID={$boardID}&pageID={$pageID}", "category={$board->alias}", 'mhtml'); $this->view->desktopURL = helper::createLink('forum', 'board', "borderID={$boardID}&pageID={$pageID}", "category={$board->alias}", 'html'); $this->display(); }
/** * index * * @param int $words * @param int $pageID * @access public * @return void */ public function index($words = '', $pageID = 1) { if (empty($words)) { $words = $this->get->words; } $words = strip_tags(strtolower($words)); if (isset($this->config->cn2tw) and $this->config->cn2tw and $this->app->getClientLang() == 'zh-tw') { $this->app->loadClass('cn2tw', true); $words = cn2tw::reverse($words); } $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal = 0, $this->config->search->recPerPage, $pageID); $this->session->set('serachIngWord', $words); $begin = time(); $this->view->results = $this->search->getList($words, $pager); /* Record post number. */ $this->loadModel('guarder')->logOperation('ip', 'search'); $this->loadModel('guarder')->logOperation('account', 'search'); $this->view->consumed = time() - $begin; $this->view->title = $this->lang->search->index; $this->view->pager = $pager; $this->view->words = $words; $this->view->mobileURL = helper::createLink('search', 'index', "words={$words}&pageID={$pageID}", '', 'mhtml'); $this->view->desktopURL = helper::createLink('search', 'index', "words={$words}&pageID={$pageID}", '', 'html'); $this->display(); }
/** * Print files. * * @param object $files * @access public * @return void * @todo fix style. */ public function printFiles($files) { if (empty($files)) { return false; } $imagesHtml = ''; $filesHtml = ''; foreach ($files as $file) { if ($file->editor) { continue; } if ($file->isVideo) { continue; } $file->title = $file->title . ".{$file->extension}"; $fileMD5 = md5_file(rtrim($this->app->getWwwRoot(), '/') . $file->fullURL); if ($file->isImage) { if ($file->objectType == 'product') { continue; } $imagesHtml .= "<li class='file-image file-{$file->extension}'>" . html::a(helper::createLink('file', 'download', "fileID={$file->id}&mouse=left"), html::image($file->smallURL), "target='_blank' data-toggle='lightbox' data-img-width='{$file->width}' data-img-height='{$file->height}' title='{$file->title}'") . '</li>'; } else { $filesHtml .= "<li class='file file-{$file->extension}'>"; $filesHtml .= html::a(helper::createLink('file', 'download', "fileID={$file->id}&mouse=left"), $file->title, "target='_blank' title='{$file->title}'"); $filesHtml .= "<span class='file-download'><i class='icon-download'></i> " . $file->downloads . "</span>"; $filesHtml .= "<span class='file-md5'>"; $filesHtml .= html::a('javascript:void(0)', 'MD5', "class='label' data-toggle='popover' data-placement='bottom' data-content='{$fileMD5}'"); $filesHtml .= '</span></li>'; } } echo "<ul class='files-list clearfix'>" . $imagesHtml . $filesHtml . '</ul>'; }
/** * Request the api. * * @param string $moduleName * @param string $methodName * @param string $action * @access public * @return void */ public function request($moduleName, $methodName, $action) { $host = common::getSysURL() . $this->config->webRoot; $param = ''; if ($action == 'extendModel') { if (!isset($_POST['noparam'])) { foreach ($_POST as $key => $value) { $param .= ',' . $key . '=' . $value; } $param = ltrim($param, ','); } $url = rtrim($host, '/') . inlink('getModel', "moduleName={$moduleName}&methodName={$methodName}¶ms={$param}", 'json'); $url .= $this->config->requestType == "PATH_INFO" ? '?' : '&'; $url .= $this->config->sessionVar . '=' . session_id(); } else { if (!isset($_POST['noparam'])) { foreach ($_POST as $key => $value) { $param .= '&' . $key . '=' . $value; } $param = ltrim($param, '&'); } $url = rtrim($host, '/') . helper::createLink($moduleName, $methodName, $param, 'json'); $url .= $this->config->requestType == "PATH_INFO" ? '?' : '&'; $url .= $this->config->sessionVar . '=' . session_id(); } /* Unlock session. After new request, restart session. */ session_write_close(); $content = file_get_contents($url); session_start(); return array('url' => $url, 'content' => $content); }
/** * The index page of whole site. * * @access public * @return void */ public function index($categoryID = 0, $pageID = 1) { if (isset($this->config->site->type) and $this->config->site->type == 'blog') { $param = ($categoryID == 0 and $pageID == 1) ? '' : "categoryID={$categoryID}&pageID={$pageID}"; $this->locate($this->createLink('blog', 'index', $param)); } //SMART 产品分类信息 $product = $this->dao->select('*')->from('es_category')->where('type')->eq('product')->andWhere('parent')->eq(1)->andWhere('lang')->eq('zh-cn')->fetchAll(); foreach ($product as &$top) { $top->child = $this->dao->select('*')->from('es_category')->where('type')->eq('product')->andWhere('parent')->eq($top->id)->andWhere('lang')->eq('zh-cn')->fetchAll(); } //变更通知部分 $field = $this->dao->select('t1.*, t2.*')->from('es_article')->alias('t1')->leftJoin('es_relation')->alias('t2')->on('t1.id = t2.id')->where('t2.category')->eq(19)->limit(5)->fetchAll(); //公司新闻 $company = $this->dao->select('*')->from('es_article')->alias('t1')->leftJoin('es_relation')->alias('t2')->on('t1.id = t2.id')->where('t2.category')->eq(20)->limit(3)->fetchAll(); //应用与解决方案 $solution = $this->dao->select('*')->from('es_category')->where('type')->eq('article')->andWhere('parent')->eq(2)->andWhere('lang')->eq('zh-cn')->fetchAll(); $this->view->title = $this->config->site->indexKeywords; $this->view->mobileURL = helper::createLink('index', 'index', '', '', 'mhtml'); $this->view->desktopURL = helper::createLink('index', 'index', '', '', 'html'); $this->view->product = $product; $this->view->field = $field; $this->view->company = $company; $this->view->solution = $solution; $this->display(); }
/** * company contact. * * @access public * @return void */ public function contact() { $this->view->title = $this->lang->company->contact; $this->view->contact = $this->company->getContact(); $this->view->mobileURL = helper::createLink('company', 'contact', '', '', 'mhtml'); $this->view->desktopURL = helper::createLink('company', 'contact', '', '', 'html'); $this->display(); }
public function __construct() { parent::__construct(); if (RUN_MODE == 'admin') { $this->view->treeModuleMenu = $this->loadModel('tree')->getTreeMenu('product', 0, array('treeModel', 'createAdminLink')); $this->view->treeManageLink = html::a(helper::createLink('tree', 'browse', "type=product"), $this->lang->tree->manage); } }
/** * Browse products in my address. * * @access public * @return void */ public function browse() { $this->app->loadLang('user'); $this->view->title = $this->lang->address->browse; $this->view->addresses = $this->address->getListByAccount($this->app->user->account); $this->view->mobileURL = helper::createLink('address', 'browse', '', '', 'mhtml'); $this->view->desktopURL = helper::createLink('address', 'browse', '', '', 'html'); $this->display(); }
public function __construct() { parent::__construct(); if (RUN_MODE == 'admin') { $this->view->treeModuleMenu = $this->loadModel('tree')->getTreeMenu('product', 0, array('treeModel', 'createAdminLink')); $this->view->treeManageLink = html::a(helper::createLink('product', 'setting'), $this->lang->product->setting, "data-toggle='modal'"); $this->view->treeManageLink .= ' ' . html::a(helper::createLink('tree', 'browse', "type=product"), $this->lang->tree->manage); } }
/** * The index page of whole site. * * @access public * @return void */ public function index($categoryID = 0, $pageID = 1) { if (isset($this->config->site->type) and $this->config->site->type == 'blog') { $param = ($categoryID == 0 and $pageID == 1) ? '' : "categoryID={$categoryID}&pageID={$pageID}"; $this->locate($this->createLink('blog', 'index', $param)); } $this->view->title = $this->config->site->indexKeywords; $this->view->mobileURL = helper::createLink('index', 'index', '', '', 'mhtml'); $this->view->desktopURL = helper::createLink('index', 'index', '', '', 'html'); $this->display(); }
/** * Browse products in my cart. * * @access public * @return void */ public function browse() { $this->app->loadLang('product'); $this->app->loadConfig('product'); $this->app->loadLang('order'); $this->view->currencySymbol = $this->config->product->currencySymbol; $this->view->title = $this->lang->cart->browse; $this->view->products = $this->cart->getListByAccount($this->app->user->account); $this->view->mobileURL = helper::createLink('cart', 'browse', '', '', 'mhtml'); $this->view->desktopURL = helper::createLink('cart', 'browse', '', '', 'html'); $this->display(); }
/** * Browse slides in admin. * * @access public * @return void */ public function admin($groupID = '') { if (!$groupID) { $firstGroup = $this->loadModel('tree')->getFirst('slide'); $groupID = $firstGroup->id; } $this->view->title = $this->lang->slide->admin; $this->view->group = $groupID; $this->view->slides = $this->slide->getList($groupID); $this->view->treeModuleMenu = $this->loadModel('tree')->getTreeMenu('slide', 0, array('treeModel', 'createSlideAdminLink')); $this->view->treeManageLink = html::a(helper::createLink('tree', 'browse', "type=slide"), $this->lang->slideGroup->manage); $this->display(); }
/** * View an page. * * @param int $pageID * @access public * @return void */ public function view($pageID) { $page = $this->loadModel('article')->getPageByID($pageID); $title = $page->title; $keywords = $page->keywords . ' ' . $this->config->site->keywords; $desc = $page->summary; $this->view->title = $title; $this->view->keywords = $keywords; $this->view->desc = $desc; $this->view->page = $page; $this->view->mobileURL = helper::createLink('page', 'view', "pageID={$pageID}", "name={$page->alias}", 'mhtml'); $this->view->desktopURL = helper::createLink('page', 'view', "pageID={$pageID}", "name={$page->alias}", 'html'); $this->dao->update(TABLE_ARTICLE)->set('views = views + 1')->where('id')->eq($page->id)->exec(false); $this->display(); }
/** * Print files. * * @param object $files * @access public * @return void * @todo fix style. */ public function printFiles($files) { if (empty($files)) { return false; } $imagesHtml = ''; $filesHtml = ''; foreach ($files as $file) { $file->title = $file->title . ".{$file->extension}"; if ($file->isImage) { $imagesHtml .= "<li class='file-image file-{$file->extension}'>" . html::a(helper::createLink('file', 'download', "fileID={$file->id}&mouse=left"), html::image($file->smallURL), "target='_blank' data-toggle='lightbox' data-width='{$file->width}' data-height='{$file->height}'") . '</li>'; } else { $filesHtml .= "<li class='file file-{$file->extension}'>" . html::a(helper::createLink('file', 'download', "fileID={$file->id}&mouse=left"), $file->title, "target='_blank'") . '</li>'; } } echo "<ul class='article-files clearfix'>" . $imagesHtml . $filesHtml . '</ul>'; }
/** * index * * @param int $words * @param int $pageID * @access public * @return void */ public function index($words = '', $pageID = 1) { if (empty($words)) { $words = $this->get->words; } $words = strip_tags(strtolower($words)); $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal = 0, $this->config->search->recPerPage, $pageID); $this->session->set('serachIngWord', $words); $begin = time(); $this->view->results = $this->search->getList($words, $pager); $this->view->consumed = time() - $begin; $this->view->title = $this->lang->search->index; $this->view->pager = $pager; $this->view->words = $words; $this->view->mobileURL = helper::createLink('search', 'index', "words={$words}&pageID={$pageID}", '', 'mhtml'); $this->view->desktopURL = helper::createLink('search', 'index', "words={$words}&pageID={$pageID}", '', 'html'); $this->display(); }
public function getLibs($type = 'info') { if (!$this->app->dbh->query('show tables from `' . $this->config->db->name . '` where `Tables_in_' . $this->config->db->name . "`='" . $this->config->db->prefix . "info'")->fetch(PDO::FETCH_OBJ)->{'Tables_in_' . $this->config->db->name}) { echo js::alert('You Hava Delete All the Database Related To This Plugin!!!\\nPlease delete this plugin!'); die(js::locate(helper::createLink('extension', 'browse'), 'parent')); } //此处有一个历史遗留问题,0.3版本以前的infolib库里无type列 $test = $this->app->dbh->query('desc ' . TABLE_INFOLIB . ' type')->fetch(PDO::FETCH_OBJ); //print $test->Field.'<br />'; if (!$test->Field) { $infolibs = $this->dao->select('id, name')->from(TABLE_INFOLIB)->where('deleted')->eq(0)->fetchPairs(); //echo js::alert($this->lang->info->pleaseUpgrade); } else { $infolibs = $this->dao->select('id, name')->from(TABLE_INFOLIB)->where('deleted')->eq(0)->andWhere('type')->eq($type)->fetchPairs(); } // while (list($key, $val) = each($test)) { // echo "$key => $val\n"; // } return $infolibs; }
/** * Read an article. * * @param int $articleID * @access public * @return void */ public function read($articleID) { $article = $this->book->getNodeByID($articleID); if (!$article) { die($this->fetch('error', 'index')); } $parent = $article->origins[$article->parent]; $book = $article->book; $content = $this->book->addMenu($article->content); $this->view->title = $article->title . ' - ' . $book->title; $this->view->keywords = $article->keywords; $this->view->desc = $article->summary; $this->view->article = $article; $this->view->content = $content; $this->view->parent = $parent; $this->view->book = $book; $this->view->prevAndNext = $this->book->getPrevAndNext($article); $this->view->mobileURL = helper::createLink('book', 'read', "articleID={$article->id}", "book={$book->alias}&node={$article->alias}", 'mhtml'); $this->view->desktopURL = helper::createLink('book', 'read', "articleID={$article->id}", "book={$book->alias}&node={$article->alias}", 'html'); $this->dao->update(TABLE_BOOK)->set('views = views + 1')->where('id')->eq($articleID)->exec(); $this->display(); }
/** * Undelete a record. * * @param int $actionID * @access public * @return void */ public function undelete($actionID) { $action = $this->getById($actionID); if ($action->action != 'deleted') { return; } if ($action->objectType == 'product') { $product = $this->dao->select('name,code')->from(TABLE_PRODUCT)->where('id')->eq($action->objectID)->fetch(); $count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PRODUCT)->where('name')->eq($product->name)->orWhere('code')->eq($product->code)->fetch('count'); if ($count > 0) { echo js::alert(sprintf($this->lang->action->needEdit, $this->lang->action->objectTypes['product'])); die(js::locate(helper::createLink('product', 'edit', "productID={$action->objectID}&action=undelete&extra={$actionID}"), 'parent')); } } elseif ($action->objectType == 'project') { $project = $this->dao->select('name,code')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch(); $count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PROJECT)->where('name')->eq($project->name)->orWhere('code')->eq($project->code)->fetch('count'); if ($count > 0) { echo js::alert(sprintf($this->lang->action->needEdit, $this->lang->action->objectTypes['project'])); die(js::locate(helper::createLink('project', 'edit', "projectID={$action->objectID}&action=undelete&extra={$actionID}"), 'parent')); } } /* Update deleted field in object table. */ $table = $this->config->objectTables[$action->objectType]; $this->dao->update($table)->set('deleted')->eq(0)->where('id')->eq($action->objectID)->exec(); /* Update action record in action table. */ $this->dao->update(TABLE_ACTION)->set('extra')->eq(ACTIONMODEL::BE_UNDELETED)->where('id')->eq($actionID)->exec(); $this->create($action->objectType, $action->objectID, 'undeleted'); }
/** * Browse tasks in group. * * @param int $projectID * @param string $groupBy the field to group by * @access public * @return void */ public function grouptask($projectID = 0, $groupBy = 'story') { $project = $this->commonAction($projectID); $projectID = $project->id; /* Save session. */ $this->app->session->set('taskList', $this->app->getURI(true)); $this->app->session->set('storyList', $this->app->getURI(true)); /*get productID*/ $products = $this->loadModel('product')->getPairs(); $productsAll = $this->loadModel('project')->getProducts($projectID); foreach ($productsAll as $productID => $productName) { $product_id = $productID; $product_name = $productName; } /*get planID*/ $plans = $this->loadModel('productplan')->getPairs($product_id); $plan_id = $this->loadModel('project')->getPlanByProjectID($projectID); /* Header and session. */ $this->view->title = $project->name . $this->lang->colon . $this->lang->project->task; $this->view->position[] = html::a(helper::createLink("product", "productplan", "productID={$product_id}"), $products[$product_id]); $this->view->position[] = html::a(helper::createLink("pro", "index", "planID={$plan_id}"), $plans[$plan_id]); $this->view->position[] = html::a($this->createLink('sprint', 'task', "projectID={$projectID}"), $project->name); $this->view->position[] = $this->lang->project->task; /* Get tasks and group them. */ $tasks = $this->loadModel('task')->getProjectTasks($projectID, $status = 'all', $groupBy ? $groupBy : 'story'); $groupBy = strtolower(str_replace('`', '', $groupBy)); $taskLang = $this->lang->task; $groupByList = array(); $groupTasks = array(); /* Get users. */ $users = $this->loadModel('user')->getPairs('noletter'); foreach ($tasks as $task) { if ($groupBy == '') { $groupTasks[$task->story][] = $task; $groupByList[$task->story] = $task->storyTitle; } elseif ($groupBy == 'story') { $groupTasks[$task->story][] = $task; $groupByList[$task->story] = $task->storyTitle; } elseif ($groupBy == 'status') { $groupTasks[$taskLang->statusList[$task->status]][] = $task; } elseif ($groupBy == 'assignedto') { $groupTasks[$task->assignedToRealName][] = $task; } elseif ($groupBy == 'openedby') { $groupTasks[$users[$task->openedBy]][] = $task; } elseif ($groupBy == 'finishedby') { $groupTasks[$users[$task->finishedBy]][] = $task; } elseif ($groupBy == 'closedby') { $groupTasks[$users[$task->closedBy]][] = $task; } elseif ($groupBy == 'type') { $groupTasks[$taskLang->typeList[$task->type]][] = $task; } else { $groupTasks[$task->{$groupBy}][] = $task; } } /* Assign. */ $this->view->members = $this->project->getTeamMembers($projectID); $this->view->tasks = $groupTasks; $this->view->tabID = 'task'; $this->view->groupByList = $groupByList; $this->view->browseType = 'group'; $this->view->groupBy = $groupBy; $this->view->orderBy = $groupBy; $this->view->projectID = $projectID; $this->view->users = $users; $this->display(); }
/** * Create link. * * @param string $title * @access private * @return string */ private function createLink($title) { global $config; if (helper::inSeoMode() && method_exists('uri', 'create' . $this->moduleName . $this->methodName)) { $link = $_SERVER['REQUEST_URI']; if ($this->params['pageID'] == 1) { return html::a(preg_replace('/\\/p\\d+\\./', '.', $link), $title); } if (preg_match('/\\/p\\d+/', $link)) { return html::a(preg_replace('/\\/p\\d+\\./', '/p' . $this->params['pageID'] . '.', $link), $title); } return html::a(str_replace('.', "/p{$this->params['pageID']}.", $link), $title); } return html::a(helper::createLink($this->moduleName, $this->methodName, $this->params), $title); }
/** * Process links of search results. * * @param array $results * @access public * @return array */ public function processLinks($results) { foreach ($results as $record) { $record->params = json_decode($record->params); if ($record->objectType == 'article') { $record->url = helper::createLink('article', 'view', "id={$record->objectID}", "category={$record->params->category}&name={$record->params->alias}"); } if ($record->objectType == 'product') { $record->url = helper::createLink('product', 'view', "id={$record->objectID}", "category={$record->params->category}&name={$record->params->alias}"); } if ($record->objectType == 'thread') { $record->url = helper::createLink('thread', 'view', "id={$record->objectID}"); } if ($record->objectType == 'blog') { $record->url = helper::createLink('blog', 'view', "id={$record->objectID}", "category={$record->params->category}&name={$record->params->alias}"); } if ($record->objectType == 'page') { $record->url = helper::createLink('page', 'view', "id={$record->objectID}", "name={$record->params->alias}"); } if ($record->objectType == 'book') { $record->url = helper::createLink('book', 'read', "id={$record->objectID}", "book={$record->params->book}&node={$record->params->alias}"); } } return $results; }
<?php if (!defined("RUN_MODE")) { die; } include "header.html.php"; ?> <form method='post' action='<?php echo helper::createLink('ui', 'setlogo'); ?> ' class='ve-form mw-800px center-block' enctype='multipart/form-data'> <table class='table table-form'> <tr> <th><?php echo $lang->site->name; ?> </th> <td><?php echo html::input('name', $this->config->site->name, "class='form-control'"); ?> </td><td></td> </tr> <tr> <th> <?php echo $lang->ui->logo; ?> </th> <td><?php echo html::file('files', "class='form-control'"); ?>
/** * Print actions of an order. * * @param string $order * @access public * @return string */ public function printActions($order, $btnLink = false) { if (RUN_MODE == 'admin' and $order->status == 'normal') { /* Send link. */ if ($order->payment == 'COD' and $order->deliveryStatus == 'not_send') { echo html::a(helper::createLink('order', 'delivery', "orderID={$order->id}"), $this->lang->order->delivery, "data-toggle='modal'"); } if ($order->payment != 'COD' and $order->payStatus == 'paid' and $order->deliveryStatus == 'not_send') { echo html::a(helper::createLink('order', 'delivery', "orderID={$order->id}"), $this->lang->order->delivery, "data-toggle='modal'"); } /* Pay link. */ if ($order->payment == 'COD' and $order->payStatus != 'paid' and $order->deliveryStatus == 'confirmed') { echo html::a(helper::createLink('order', 'pay', "orderID={$order->id}"), $this->lang->order->return, "data-toggle='modal'"); } /* Finish link. */ if ($order->payStatus == 'paid' and $order->deliveryStatus == 'confirmed' and $order->status != 'finished' and $order->status != 'canceled') { echo html::a('javascript:;', $this->lang->order->finish, "data-rel='" . helper::createLink('order', 'finish', "orderID={$order->id}") . "' class='finisher'"); } } if (RUN_MODE == 'front' and $order->status == 'normal') { if ($btnLink) { /* Pay link. */ if ($order->payment != 'COD' and $order->payStatus != 'paid') { echo html::a($this->createPayLink($order), $this->lang->order->pay, "target='_blank' class='btn-go2pay btn warning'"); } /* Track link. */ if ($order->deliveryStatus != 'not_send') { echo html::a(inlink('track', "orderID={$order->id}"), $this->lang->order->track, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' data-toggle='modal' class='btn btn-link'"); } /* Confirm link. */ if ($order->deliveryStatus == 'send') { echo html::a('javascript:;', $this->lang->order->confirmReceived, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' class='confirmDelivery btn primary'"); } /* Cancel link. */ if ($order->deliveryStatus == 'not_send' and $order->payStatus != 'paid' and $order->status == 'normal') { echo html::a('javascript:;', $this->lang->order->cancel, "data-rel='" . helper::createLink('order', 'cancel', "orderID={$order->id}") . "' class='cancelLink btn btn-link'"); } } else { /* Pay link. */ if ($order->payment != 'COD' and $order->payStatus != 'paid') { echo html::a($this->createPayLink($order), $this->lang->order->pay, "target='_blank' class='btn-go2pay'"); } /* Track link. */ if ($order->deliveryStatus != 'not_send') { echo html::a(inlink('track', "orderID={$order->id}"), $this->lang->order->track, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' data-toggle='modal'") . '<br>'; } /* Confirm link. */ if ($order->deliveryStatus == 'send') { echo html::a('javascript:;', $this->lang->order->confirmReceived, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' class='confirmDelivery'"); } /* Cancel link. */ if ($order->deliveryStatus == 'not_send' and $order->payStatus != 'paid' and $order->status == 'normal') { echo html::a('javascript:;', $this->lang->order->cancel, "data-rel='" . helper::createLink('order', 'cancel', "orderID={$order->id}") . "' class='cancelLink'"); } } } }
/** * Create link. * * @param string $title * @access private * @return string */ private function createLink($title) { global $config; if (helper::inSeoMode() && method_exists('uri', 'create' . $this->moduleName . $this->methodName)) { $link = strip_tags(urldecode($_SERVER['REQUEST_URI'])); if ($this->params['pageID'] == 1) { return html::a(preg_replace('/\\/p\\d+\\./', '.', $link), $title); } if (preg_match('/\\/p\\d+/', $link)) { return html::a(preg_replace('/\\/p\\d+\\./', '/p' . $this->params['pageID'] . '.', $link), $title); } if ($config->requestType == 'PATH_INFO2') { $link = str_replace('index.php/', 'index_php/', $link); } $link = str_replace('.', "/p{$this->params['pageID']}.", $link); if ($config->requestType == 'PATH_INFO2') { $link = str_replace('index_php/', 'index.php/', $link); } return html::a($link, $title); } return html::a(helper::createLink($this->moduleName, $this->methodName, $this->params), $title); }
/** * Get all replies of a message for front. * * @param object $message * @access public * @return array */ public function getFrontReplies($message, $type = '') { $replies = $this->getReplies($message); if (!empty($replies)) { if ($type !== 'simple') { foreach ($replies as $reply) { echo "<tr class='reply'>"; echo "<th class='th-from text-important'>{$reply->from}<br />"; echo "<span class='time'>" . formatTime($reply->date, 'Y/m/d') . "</span></th>"; echo "<td class='td-content'><div class='content-detail'>" . nl2br($reply->content) . '</div></td>'; echo "<td class='td-action'>"; echo html::a(helper::createLink('message', 'reply', "id={$reply->id}"), $this->lang->message->reply, " data-toggle='modal' data-type='iframe' id='reply{$reply->id}'"); echo '</td>'; echo '</tr>'; $this->getFrontReplies($reply); } } else { echo "<div class='replies'>"; foreach ($replies as $reply) { echo "<div class='reply card'>"; echo "<div class='card-heading'>"; echo "<span class='text-primary'><i class='icon-reply'></i> {$reply->from}</span> <small class='text-muted'>" . formatTime($reply->date, 'Y/m/d H:m') . "</small>"; echo "<div class='actions'>" . html::a(helper::createLink('message', 'reply', "id={$reply->id}"), $this->lang->message->reply, " data-toggle='modal' data-type='ajax' id='reply{$reply->id}'") . "</div>"; echo '</div>'; echo "<div class='card-content'>" . nl2br($reply->content) . "</div>"; $this->getFrontReplies($reply, $type); echo '</div>'; } echo '</div>'; } } }
/** * Create the link from module,method,extra * * @param string $module * @param string $method * @param mix $extra * @access public * @return void */ public function getProjectLink($module, $method, $extra) { $link = ''; if ($module == 'task' and $method == 'view' || $method == 'edit' || $method == 'batchedit') { $module = 'project'; $method = 'task'; } if ($module == 'build' and $method == 'edit' || ($method = 'view')) { $module = 'project'; $method = 'build'; } if ($module == 'project' and $method == 'create') { return; } if ($extra != '') { $link = helper::createLink($module, $method, "projectID=%s&type={$extra}"); } elseif ($module == 'project' && $method == 'index') { $link = helper::createLink($module, $method, "locate=no&status=undone&projectID=%s"); } else { $link = helper::createLink($module, $method, "projectID=%s"); } return $link; }
if (isset($content->showCategory) and $content->showCategory == 1) { ?> <?php if ($content->categoryName == 'abbr') { ?> <?php $categoryName = '[' . ($article->category->abbr ? $article->category->abbr : $article->category->name) . '] '; ?> <?php echo html::a(helper::createLink('article', 'browse', "categoryID={$article->category->id}", "category={$article->category->alias}"), $categoryName); ?> <?php } else { ?> <?php echo html::a(helper::createLink('article', 'browse', "categoryID={$article->category->id}", "category={$article->category->alias}"), '[' . $article->category->name . '] '); ?> <?php } ?> <?php } ?> <?php echo html::a($url, $article->title, "title='{$article->title}'"); ?> <?php if ($article->sticky) { ?> <span class='label label-danger'><?php echo $this->lang->article->stick;