예제 #1
0
파일: Social.php 프로젝트: suyuanen/trotri
 /**
  * (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);
 }
예제 #2
0
파일: Social.php 프로젝트: suyuanen/trotri
 /**
  * (non-PHPdoc)
  * @see \tfc\mvc\interfaces\Action::run()
  */
 public function run()
 {
     Text::_('MOD_MEMBER__');
     $mod = Model::getInstance('Social', 'member');
     $row = $mod->findByPk(Identity::getUserId());
     if (is_array($row) && isset($row['birth_ymd'])) {
         $row['birth_y'] = substr($row['birth_ymd'], 0, 4);
         $row['birth_m'] = substr($row['birth_ymd'], 5, 2);
         $row['birth_d'] = substr($row['birth_ymd'], 8, 2);
     }
     //\tfc\saf\debug_dump($row);
     $this->assign('sex_enum', DataSocial::getSexEnum());
     $this->assign('interests_enum', DataSocial::getInterestsEnum());
     $this->render($row);
 }
예제 #3
0
파일: NavBar.php 프로젝트: suyuanen/trotri
 /**
  * (non-PHPdoc)
  * @see \tfc\mvc\Widget::run()
  */
 public function run()
 {
     $output = '';
     $html = $this->getHtml();
     $config = Cfg::getApp('navbar');
     foreach ($config as $menus) {
         $main = array_shift($menus);
         if (!is_array($main)) {
             continue;
         }
         // 主菜单
         if (!$menus) {
             $output .= $html->tag('li', $this->getAttributes($main, false), $this->a($main)) . "\n";
             continue;
         }
         // 主菜单外开始标签
         $output .= $html->openTag('li', $this->getAttributes($main, true)) . "\n";
         $output .= $this->a($main, true) . "\n";
         // 下拉子菜单外开始标签
         $output .= $html->openTag('ul', array('class' => 'dropdown-menu')) . "\n";
         // 下拉子菜单列表
         $total = count($menus);
         $curr = 0;
         foreach ($menus as $menu) {
             $output .= $html->tag('li', array(), $this->a($menu)) . "\n";
             if (++$curr < $total) {
                 $output .= $html->tag('li', array('class' => 'divider'), '') . "\n";
             }
         }
         // 下拉子菜单外结束标签
         $output .= $html->closeTag('ul') . "\n";
         // 主菜单外结束标签
         $output .= $html->closeTag('li') . "\n";
     }
     $this->assign('is_login', Identity::isLogin());
     $this->assign('user_id', Identity::getUserId());
     $this->assign('login_name', Identity::getLoginName());
     $this->assign('user_name', Identity::getNickname());
     $this->assign('app_names', Identity::getAppNames());
     $this->assign('menus', $output);
     $this->assign('logout', $this->getView()->CFG_SYSTEM_GLOBAL_LOGOUT);
     $this->display();
 }
예제 #4
0
파일: Posts.php 프로젝트: suyuanen/trotri
 /**
  * 通过主键,编辑一条记录
  * @param integer $id
  * @param array $params
  * @return array
  */
 public function modifyByPk($id, array $params = array())
 {
     $params['last_modifier_id'] = Identity::getUserId();
     if (isset($params['content'])) {
         $params['content'] = String::stripslashes($params['content']);
     }
     return parent::modifyByPk($id, $params);
 }
예제 #5
0
파일: Members.php 프로젝트: suyuanen/trotri
 /**
  * 操作会员账户
  * @param string $columnName
  * @param string $opType
  * @param integer $memberId
  * @param integer|float $value
  */
 public function opAccount($columnName, $opType, $memberId, $value)
 {
     $funcName = 'op' . ucfirst(strtolower($columnName));
     $ret = $this->getService()->{$funcName}($opType, $memberId, $value, DataMembers::SOURCE_ADMINOP, '', Identity::getUserId());
     if ($ret) {
         $errNo = ErrorNo::SUCCESS_NUM;
         $errMsg = Lang::_('ERROR_MSG_SUCCESS_UPDATE');
     } else {
         $errNo = ErrorNo::ERROR_DB_UPDATE;
         $errMsg = Lang::_('ERROR_MSG_ERROR_DB_UPDATE');
     }
     return array('err_no' => $errNo, 'err_msg' => $errMsg);
 }
예제 #6
0
파일: Vote.php 프로젝트: suyuanen/trotri
 /**
  * 投票
  * @param string $pollKey
  * @param string $value
  * @return array
  */
 public function addVote($pollKey, $value)
 {
     $ret = $this->_service->addVote($pollKey, $value, Identity::getUserId(), Identity::getRankId());
     return $ret;
 }
예제 #7
0
 /**
  * 将会员账户信息设置到模板变量中
  * @return void
  */
 public function assignAccount()
 {
     $viw = Mvc::getView();
     $viw->assign('is_login', Identity::isLogin());
     $viw->assign('member_id', Identity::getUserId());
     $viw->assign('login_name', Identity::getLoginName());
     $viw->assign('member_name', Identity::getNickname());
     $viw->assign('type_id', Identity::getTypeId());
     $viw->assign('rank_id', Identity::getRankId());
 }