/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $submitType = $req->getTrim('submit_type'); $id = $req->getInteger('id'); $columnName = $req->getTrim('column_name'); $opType = $req->getTrim('op_type'); $value = $req->getParam('value'); if ($submitType === 'save') { $mod = Model::getInstance('Members'); $ret = $mod->opAccount($columnName, $opType, $id, $value); $url = $this->applyParams($mod->getLLU(), $ret); $this->redirect($url); exit; } $loginName = $req->getTrim('login_name'); $html = Mvc::getView()->getHtml(); $title = Text::_('MOD_MEMBER_MEMBERS_OP_' . $columnName . '_' . $opType) . ': ' . $loginName . ' , ' . $value; $url = Mvc::getView()->getUrlManager()->getUrl('ajaxaccount', Mvc::$controller, Mvc::$module, array('id' => $id, 'column_name' => $columnName, 'op_type' => $opType, 'submit_type' => 'save', 'value' => '')); $body = $html->input('hidden', 'url', $url); $body .= $html->openTag('div', array('class' => 'form-group')); $body .= $html->tag('label', array('class' => 'col-lg-2 control-label'), Text::_('MOD_MEMBER_MEMBERS_OP_' . $opType)); $body .= $html->tag('div', array('class' => 'col-lg-4'), $html->input('text', 'value', '', array('class' => 'form-control input-sm'))); if ($opType === 'reduce' || $opType === 'reduce_freeze' || $opType === 'freeze') { $body .= $html->tag('span', array('class' => 'control-label'), Text::_('MOD_MEMBER_MEMBERS_OP_REDUCE_HINT')); } $body .= $html->closeTag('div'); $this->display(array('title' => $title, 'body' => $body)); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $mod = Model::getInstance('Social', 'member'); $ret = $mod->modifyByPk(Identity::getUserId(), $req->getPost()); $this->display($ret); }
/** * (non-PHPdoc) * @see \views\bootstrap\components\form\IRadioElement::getInput() */ public function getInput() { $req = Ap::getRequest(); $imgUrl = $req->getBaseUrl() . '/static/images/advtypes/'; $imgExt = '.gif'; $this->setAttribute('class', 'icheck'); $type = $this->getType(); $name = $this->getName(true); $attributes = $this->getAttributes(); $html = $this->getHtml(); $tagName = 'label'; $tagAttributes = array('class' => 'checkbox-inline'); $output = ''; $p = 0; foreach ($this->options as $value => $prompt) { if ($p++ % 4 === 0 && $p !== 1) { $output .= $html->tag('label', array('class' => 'col-lg-2 control-label'), ''); } $prompt = $html->img($imgUrl . $value . $imgExt, $prompt, array('title' => $prompt)); $checked = $value == $this->value ? true : false; $output .= $html->tag($tagName, $tagAttributes, $html->{$type}($name, $value, $checked, $attributes)); $output .= $html->tag($tagName, $tagAttributes, $prompt); if ($p % 4 === 0) { $output .= $html->tag('br'); } } return $output; }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $mod = Model::getInstance('Amcas'); $apps = $mod->findAppPrompts(); if ($apps === array()) { $this->err404(); } $appId = $req->getInteger('app_id'); if ($appId === 0) { $row = array_keys(array_slice($apps, 0, 1, true)); $appId = array_shift($row); } if (!isset($apps[$appId])) { $this->err404(); } $prompt = $apps[$appId]; unset($apps[$appId]); $apps = array($appId => $prompt) + $apps; $ret = $mod->findModCtrls($appId); if ($ret['err_no'] !== ErrorNo::SUCCESS_NUM) { $this->err404(); } $mod->setLLU(array('app_id' => $appId)); $this->assign('apps', $apps); $this->assign('app_id', $appId); $this->assign('elements', $mod); $this->render($ret); }
/** * 构造方法:初始化页面编码方式 * @param string $encoding */ public function __construct($encoding = null) { if ($encoding === null) { $encoding = Ap::getEncoding(); } $this->setEncoding($encoding); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $id = $this->getPk(); if ($id <= 0) { $this->err404(); } $ret = array(); $req = Ap::getRequest(); $mod = Model::getInstance('Groups'); $submitType = new SubmitType(); if ($submitType->isPost()) { $ret = $mod->modifyPermissionByPk($id, $req->getPost('amcas', array())); if ($ret['err_no'] === ErrorNo::SUCCESS_NUM) { if ($submitType->isTypeSave()) { $this->forward('permissionmodify', Mvc::$controller, Mvc::$module, $ret); } elseif ($submitType->isTypeSaveClose()) { $url = $this->applyParams($mod->getLLU(), $ret); $this->redirect($url); } } else { $amcas = $mod->getAmcas($id); $ret['data'] = $amcas['data']; } } else { $ret = $mod->getAmcas($id); } $this->assign('id', $id); $this->assign('breadcrumbs', $mod->getBreadcrumbs($id)); $this->assign('elements', $mod); $this->render($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $mod = Model::getInstance('Topic', 'topic'); $paged = PageHelper::getCurrPage(); $ret = $mod->findRows($paged); $this->render($ret); }
/** * 以单入口Mvc方式运行项目 * @return void */ public static function run() { $router = self::getRouter()->route(Ap::getRequest()); self::$module = $router->getModule(); self::$action = $router->getAction(); self::$controller = $router->getController(); self::getDispatcher()->run($router); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $memberMail = $req->getTrim('member_mail'); $mod = Model::getInstance('Repwd', 'member'); $ret = $mod->sendMail($memberMail); $this->display($ret); }
/** * 设置国际化管理类 * @param \tfc\util\Language $language * @return void */ public static function setLanguage(Language $language = null) { if ($language === null) { $type = Ap::getLanguageType(); $baseDir = DIR_APP_LANGUAGES; $language = Language::getInstance($type, $baseDir); } self::$_language = $language; }
/** * 获取系统信息 * @return array */ public static function getSysInfo() { static $metadata = null; if ($metadata === null) { $metadata = new Metadata(self::getInstance()->getDb()->getDbProxy()); } $data = array('tfcversion' => Ap::getVersion(), 'dbversion' => $metadata->getVersion(), 'phpversion' => PHP_OS . ' / PHP v' . PHP_VERSION . (@ini_get('safe_mode') ? ' Safe Mode' : ''), 'software' => Ap::getRequest()->getServer('SERVER_SOFTWARE'), 'maxupsize' => @ini_get('file_uploads') ? ini_get('upload_max_filesize') : Lang::_('SRV_ENUM_GLOBAL_UNKOWN')); return $data; }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $tblName = Ap::getRequest()->getTrim('tbl_name'); if ($tblName === '') { $this->err404(); } $mod = Model::getInstance('Tblnames'); $mod->gb($tblName); }
/** * 获取type_key值 * @return string */ public function getTypeKey() { $typeKey = Ap::getRequest()->getTrim('type_key'); if ($typeKey === '') { $id = Ap::getRequest()->getInteger('id'); $typeKey = $this->getService()->getTypeKeyByMenuId($id); } return $typeKey; }
/** * 获取field_id值 * @return integer */ public function getFieldId() { $fieldId = Ap::getRequest()->getInteger('field_id'); if ($fieldId <= 0) { $id = Ap::getRequest()->getInteger('id'); $fieldId = $this->getService()->getByPk('field_id', $id); } return $fieldId; }
/** * 获取member_id值 * @return integer */ public function getMemberId() { $memberId = Ap::getRequest()->getInteger('member_id'); if ($memberId <= 0) { $id = Ap::getRequest()->getInteger('id'); $memberId = $this->getService()->getMemberIdByAddressId($id); } return $memberId; }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $pollKey = $req->getTrim('key'); $value = $req->getTrim('value'); $mod = Model::getInstance('Vote', 'poll'); $ret = $mod->addVote($pollKey, $value); $this->display($ret); }
/** * 获取poll_id值 * @return integer */ public function getPollId() { $pollId = Ap::getRequest()->getInteger('poll_id'); if ($pollId <= 0) { $id = Ap::getRequest()->getInteger('id'); $pollId = $this->getService()->getPollIdByOptionId($id); } return $pollId; }
/** * 获取builder_id值 * @return integer */ public function getBuilderId() { $builderId = Ap::getRequest()->getInteger('builder_id'); if ($builderId <= 0) { $id = Ap::getRequest()->getInteger('id'); $builderId = $this->getService()->getByPk('builder_id', $id); } return $builderId; }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $loginName = $req->getTrim('login_name'); $password = $req->getTrim('password'); $repassword = $req->getTrim('repassword'); $mod = Model::getInstance('Account', 'member'); $ret = $mod->register($loginName, $password, $repassword); $this->display($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $postId = $req->getInteger('postid'); $order = $req->getTrim('order', 'dt_last_modified DESC'); $paged = PageHelper::getCurrPage(); $mod = Model::getInstance('Comments', 'posts'); $ret = $mod->getRowsByPostId($postId, $order, $paged); $this->display($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $ciphertext = $req->getTrim('cipher'); $password = $req->getTrim('password'); $repassword = $req->getTrim('repassword'); $mod = Model::getInstance('Repwd', 'member'); $ret = $mod->repwdByCipher($ciphertext, $password, $repassword); $this->display($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $loginName = $req->getTrim('login_name'); $password = $req->getTrim('password'); $rememberMe = $req->getInteger('remember_me', 0) === 1 ? true : false; $mod = Model::getInstance('Account', 'member'); $ret = $mod->login($loginName, $password, $rememberMe); $this->display($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $oldPwd = $req->getTrim('old_pwd'); $password = $req->getTrim('password'); $repassword = $req->getTrim('repassword'); $mod = Model::getInstance('Repwd', 'member'); $ret = $mod->repwdByOldPwd($oldPwd, $password, $repassword); $this->display($ret); }
/** * 通过键名获取语言内容 * @param string $string * @param boolean $jsSafe * @param boolean $interpretBackSlashes * @return string */ public static function _($string, $jsSafe = false, $interpretBackSlashes = true) { static $language = null; if ($language === null) { $type = Ap::getLanguageType(); $baseDir = substr(dirname(__FILE__), 0, -8) . DS . 'languages'; $language = Language::getInstance($type, $baseDir); } return $language->_($string, $jsSafe, $interpretBackSlashes); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $builderId = Ap::getRequest()->getInteger('builder_id'); if ($builderId <= 0) { $this->err404(); } $this->assign('builder_id', $builderId); Ap::getRequest()->setParam('order', 'sort'); $this->execute('Fields'); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $ret = array(); $req = Ap::getRequest(); $mod = Model::getInstance('Adverts'); $param = $req->getParam('sort'); $ret = $mod->batchModifySort($param); $url = $this->applyParams($mod->getLLU(), $ret); $this->redirect($url); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $mod = Model::getInstance('Groups'); $builderId = $mod->getBuilderId(); if ($builderId <= 0) { $this->err404(); } $this->assign('builder_id', $builderId); Ap::getRequest()->setParam('order', 'sort'); $this->execute('Groups'); }
/** * 单例模式:获取本类的实例化对象 * @param string $charset * @return \tfc\util\Encoder */ public static function getInstance($charset = null) { if ($charset === null) { $charset = Ap::getEncoding(); } $charset = strtoupper($charset); if (!isset(self::$_instances[$charset])) { self::$_instances[$charset] = new self($charset); } return self::$_instances[$charset]; }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $typeKey = Ap::getRequest()->getTrim('type_key'); if ($typeKey === '') { $this->err404(); } $typeName = Model::getInstance('Adverts')->getTypeNameByTypeKey($typeKey); $this->assign('type_key', $typeKey); $this->assign('type_name', $typeName); Ap::getRequest()->setParam('order', 'sort'); $this->execute('Adverts'); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $authorName = $req->getTrim('author_name'); $authorMail = $req->getTrim('author_mail'); $content = $req->getParam('content'); $postId = $req->getInteger('post_id'); $commentPid = $req->getInteger('comment_pid'); $mod = Model::getInstance('Comments', 'posts'); $ret = $mod->create(array('author_name' => $authorName, 'author_mail' => $authorMail, 'content' => $content, 'post_id' => $postId, 'comment_pid' => $commentPid)); $this->display($ret); }