public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); if (!$this->loginUser->isExists()) { $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('my/article/run'))); } }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); if (!$this->loginUser->isExists()) { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run', array('_type' => $this->getInput('_type')))); } }
/** * 显示错误 * * @param array $error array('',array()) */ protected function showError($error = '', $referer = '', $refresh = false) { $referer && ($referer = WindUrlHelper::createUrl($referer)); $this->addMessage($referer, 'referer'); $this->addMessage($refresh, 'refresh'); parent::showMessage($error); }
protected function getData($field, $order, $limit, $offset) { Wind::import('SRV:tag.vo.PwTagSo'); $so = new PwTagSo(); $field['tag_ids'] && $so->setTagId(explode(' ', $field['tag_ids'])); $field['category_id'] && $so->setCategoryId($field['category_id']); $so->setIflogo($field['islogo']); $so->setIfhot(1); switch ($field['order']) { case 0: $so->orderbyCreatedTime(); break; case 1: $so->orderbyAttentionCount(); break; case 2: $so->orderbyContentCount(); break; } $list = Wekit::load('tag.PwTagSearch')->searchTag($so, $limit, $offset); if (!$list) { return array(); } foreach ($list as $k => $v) { $list[$k]['tagid'] = $v['tag_id']; $list[$k]['tag_name'] = $this->_formatTitle($v['tag_name']); $list[$k]['url'] = WindUrlHelper::createUrl('tag/index/view', array('name' => $v['tag_name']), '', 'pw'); $list[$k]['logo'] = Pw::getPath($v['tag_logo']); $list[$k]['attention_count'] = $v['attention_count']; $list[$k]['content_count'] = $v['content_count']; $list[$k]['excerpt'] = $v['excerpt']; $list[$k]['thumb_attach'] = $v['tag_logo'] ? $v['tag_logo'] : ''; } return $list; }
public function __construct() { $config = Wekit::C('pay'); $this->tenpay = $config['tenpay']; $this->tenpay_key = $config['tenpaykey']; $this->baseurl = WindUrlHelper::createUrl('bbs/tenpay/run'); }
public function doSaveInformationAction() { list($openid, $id, $key) = $this->getInput(array('openid', 'pid', 'key')); $this->setOutput($openid, 'openId'); if (!isset($_SESSION)) { @session_start(); } $_SESSION['exchangekey'] = $key; //user validation $userMoney = $this->getUserMoneyByOpenId($openid); if (empty($userMoney) == false && isset($_SESSION['exchangekey'])) { $prize = $this->_getCommonDs()->getPrizeById($id); //check user money if (empty($prize) == false && $prize['dmoney'] <= $userMoney['money']) { $deductDMoeny = 0 - $prize['dmoney']; $isDeduct = $this->_getMyMoneyDS()->updateMyMoney($userMoney['userid'], $deductDMoeny, 0, $prize['name']); if ($isDeduct > 0) { unset($_SESSION['exchangekey']); $this->setOutput($isDeduct, "isDeduct"); } $myMoney = $this->_getMyMoneyDS()->getMyMoney($userMoney['userid']); $this->setOutput($myMoney[0], 'myMoney'); $this->setOutput($prize, "prize"); list($pid, $receiveContactor, $receivePhone, $receiveQQ, $receiveAddress) = $this->getInput(array('pid', 'receiveContactor', 'receivePhone', 'receiveQQ', 'receiveAddress')); $dm = new App_Giftexchange_Dm(); $dm->setUserId($userMoney['userid'])->setContact($receiveContactor)->setPhoneNumber($receivePhone)->setqq($receiveQQ)->setAddress($receiveAddress)->setProductId($prize['id'])->setCreateTime(Pw::getTime()); $saveInfo = $this->_getGiftexchangeDS()->add($dm); $this->setOutput($saveInfo, 'saveInfo'); } } else { $url = WindUrlHelper::createUrl('app/4tmobile/mobilemymoney/run', array('openid' => $openid)); $this->forwardRedirect($url); } }
public function __construct() { $config = Wekit::C('pay'); $this->bill = $config['99bill']; $this->bill_key = $config['99billkey']; $this->baseurl = WindUrlHelper::createUrl('bbs/pay99bill/run'); }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); if (empty($this->schoolExtra) == false && $this->schoolExtra['openliuyanban'] == 0) { $this->forwardRedirect(WindUrlHelper::createUrl('app/4tschool/notopen/run')); } }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); if ($this->loginUser->uid < 1) { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/')); } }
public function appDo($space) { if (!in_array('profile', Wekit::C('site', 'app.torrent.showuserinfo'))) { return ''; } $user = Wekit::load('EXT:torrent.service.PwTorrentUser')->getTorrentUserByUid($space->{'spaceUid'}); $torrents = Wekit::load('EXT:torrent.service.PwTorrent')->fetchTorrentByUid($space->{'spaceUid'}); $histories = Wekit::load('EXT:torrent.service.PwTorrentHistory')->fetchTorrentHistoryByUid($space->{'spaceUid'}); $passkey = $user['passkey']; $posted = count($torrents); foreach ($histories as $history) { $downloaded_total += $history['downloaded']; $uploaded_total += $history['uploaded']; } $downloaded_total = floor($downloaded_total / 1048567); $uploaded_total = floor($uploaded_total / 1048567); if ($downloaded_total != 0) { $rotio = round($uploaded_total / $downloaded_total, 2); } else { $rotio = 'Inf.'; } echo '<div class="space_profile"><h3><strong>PT个人信息</strong></h3>'; if ($space->{'visitUid'} == $space->{'spaceUid'}) { echo '<dl class="cc"><dt>Passkey:</dt><dd><span id="passkey" style="background-color:rgb(51,51,51); color:rgb(51,51,51);">' . $passkey . '</span> <button class="btn" id="btnToggle" onclick="if ($(\'#btnToggle\').text() == \'显示\') {$(\'#passkey\').css(\'background\', \'white\'); $(\'#btnToggle\').text(\'隐藏\');} else {$(\'#passkey\').css(\'background\', \'rgb(51,51,51)\');$(\'#btnToggle\').text(\'显示\');}">显示</button></dd></dl>'; echo '<dl class="cc"><dt>订阅地址:</dt><dd><a href="' . WindUrlHelper::createUrl('/app/torrent/index/rss?uid=' . $space->{'spaceUid'} . '&passkey=' . $passkey) . '">RSS 链接(请勿泄露)</a><a href="' . WindUrlHelper::createUrl('/app/torrent/index/my') . '" class="btn">管理</a></dd></dl>'; } echo '<dl class="cc"><dt>下载:</dt><dd>' . $downloaded_total . ' M</dd></dl>'; echo '<dl class="cc"><dt>上传:</dt><dd>' . $uploaded_total . ' M</dd></dl>'; echo '<dl class="cc"><dt>分享率:</dt><dd>' . $rotio . '</dd></dl>'; echo '<dl class="cc"><dt>发布:</dt><dd>' . $posted . '</dd></dl>'; echo '</div>'; }
public function run() { $page = (int) $this->getInput('page', 'get'); $perpage = 10; $args = array(); $page = $page > 1 ? $page : 1; list($start, $perpage) = Pw::page2limit($page, $perpage); $list = $this->_getPageDs()->getPageList(PwDesignPage::SYSTEM, $start, $perpage); $count = $this->_getPageDs()->countPage(PwDesignPage::SYSTEM); $sysPage = Wekit::load('design.srv.router.PwDesignRouter')->get(); foreach ($list as &$v) { if (isset($sysPage[$v['page_router']])) { list($pagename, $unique) = $sysPage[$v['page_router']]; } list($m, $c, $a, $id) = explode('|', $v['page_router']); if ($unique) { $v['url'] = WindUrlHelper::createUrl($m . '/' . $c . '/' . $a, array($unique => $v['page_unique']), '', 'pw'); } else { $v['url'] = WindUrlHelper::createUrl($m . '/' . $c . '/' . $a, array(), '', 'pw'); } $sep = strpos($v['url'], '?') === false ? '?' : '&'; $v['designurl'] = $v['url'] . $sep . 'design=1'; } $this->setOutput($list, 'list'); $this->setOutput($count, 'count'); $this->setOutput($page, 'page'); $this->setOutput($perpage, 'perpage'); $this->setOutput(ceil($count / $perpage), 'totalpage'); $this->setOutput('design/page/run', 'pageurl'); }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); $spaceUid = (int) $this->getInput('uid', 'get'); if ($spaceUid < 1) { $userName = $this->getInput('username', 'get'); $user = Wekit::load('user.PwUser')->getUserByName($userName); $spaceUid = isset($user['uid']) ? $user['uid'] : 0; } if ($spaceUid < 1) { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/')); } $this->space = new PwSpaceBo($spaceUid); if (!$this->space->space['uid']) { $user = Wekit::load('user.PwUser')->getUserByUid($spaceUid); if ($user) { Wekit::load('space.dm.PwSpaceDm'); $dm = new PwSpaceDm($spaceUid); $dm->setVisitCount(0); Wekit::load('space.PwSpace')->addInfo($dm); $this->space = new PwSpaceBo($spaceUid); } else { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/')); } } $this->space->setTome($spaceUid, $this->loginUser->uid); $this->space->setVisitUid($this->loginUser->uid); $this->setTheme('space', null); if ($this->space->allowView('space')) { $this->forwardRedirect(WindUrlHelper::createUrl('space/index/run', array('uid' => $spaceUid))); } }
public function buildTitle($param = 0, $extendParams = null, $aggregatedNotice = null) { $params = array(); $msg = ''; switch ($extendParams['change_type']) { //转账 case 'transfer': $params['{username}'] = '<a href="' . WindUrlHelper::createUrl('space/index/run', array('uid' => $extendParams['fromUid'])) . '">' . $extendParams['fromUserName'] . '</a>'; $params['{num}'] = $extendParams['num']; $params['{unit}'] = $extendParams['unit']; $params['{credit}'] = $extendParams['credit']; $msg = 'CREDIT:transfer.to.notice.format'; break; //转换: //转换: case 'exchange': $params['{credit1}'] = $extendParams['credit1']; $params['{num1}'] = $extendParams['num1']; $params['{unit1}'] = $extendParams['unit1']; $params['{credit2}'] = $extendParams['credit2']; $params['{num2}'] = $extendParams['num2']; $params['{unit2}'] = $extendParams['unit2']; $msg = 'CREDIT:exchange.notice.format'; break; case 'pay': $params['{credit}'] = $extendParams['credit']; $params['{num}'] = $extendParams['num']; $params['{unit}'] = $extendParams['unit']; $params['{price}'] = $extendParams['price']; $msg = 'CREDIT:pay.notice.format'; break; } return Wind::getComponent('i18n')->getMessage($msg, $params); }
private function _buildSignKey($list) { $_username = array(); $_tids = array(); foreach ($list as $k => $v) { $_tids[] = $v['lastpost_tid']; } $thread = $this->_getThread($_tids); foreach ($list as $k => $v) { $list[$k]['name'] = $this->_filterForumHtml($v['name']); if ($v['type'] == 'category') { $list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/cate/run', array('fid' => $v['fid']), '', 'pw'); } else { $list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/thread/run', array('fid' => $v['fid']), '', 'pw'); } $list[$k]['descrip'] = $this->_formatDes($v['descrip']); $list[$k]['logo'] = $v['logo'] ? Pw::getPath($v['logo']) : ''; $lastthread = $thread[$v['lastpost_tid']]; $list[$k]['lastpost_time'] = $this->_formatTime($lastthread['lastpost_time']); $list[$k]['lastpost_smallavatar'] = $lastthread['lastpost_userid'] ? Pw::getAvatar($lastthread['lastpost_userid'], 'small') : ''; $list[$k]['lastpost_middleavatar'] = $lastthread['lastpost_userid'] ? Pw::getAvatar($lastthread['lastpost_userid'], 'middle') : ''; $list[$k]['lastpost_userid'] = $lastthread['lastpost_userid']; $list[$k]['lastpost_username'] = $lastthread['lastpost_username']; $list[$k]['lastpost_space'] = $lastthread['lastpost_userid'] ? WindUrlHelper::createUrl('space/index/run', array('uid' => $lastthread['lastpost_userid']), '', 'pw') : ''; $list[$k]['lastthread_space'] = $lastthread['created_userid'] ? WindUrlHelper::createUrl('space/index/run', array('uid' => $lastthread['created_userid']), '', 'pw') : ''; $list[$k]['lastthread_smallavatar'] = $lastthread['created_userid'] ? Pw::getAvatar($lastthread['created_userid'], 'small') : ''; $list[$k]['lastthread_middleavatar'] = $lastthread['created_userid'] ? Pw::getAvatar($lastthread['created_userid'], 'middle') : ''; $list[$k]['lastthread_username'] = $lastthread['created_username']; $list[$k]['lastthread_time'] = $this->_formatTime($lastthread['created_time']); $list[$k]['lastthread'] = $this->_formatTitle($lastthread['subject']); } return $list; }
/** * 发送动作页面,一般是ajax提交的数据 */ public function sendAction() { $act = $this->getInput('act', 'post'); $uid = $this->getInput('uid', 'post'); if (!$act) { $this->showError('请选择动作'); } if (!$uid) { $this->showError('请选择用户'); } !is_array($uid) && ($uid = array($uid)); Wind::import('EXT:dongta.service.dm.App_Dongta_Dm'); $service = Wekit::load('EXT:dongta.service.App_Dongta'); $users = Wekit::load('user.PwUser')->fetchUserByUid($uid); $actMap = (include Wind::getRealPath('EXT:dongta.conf.dongta.php', true)); $title = '<a href="' . WindUrlHelper::createUrl('space/index/run', array('uid' => $this->loginUser->uid)) . '">' . $this->loginUser->username . '</a> ' . str_replace('{Ta}', '你', $actMap[$act][1]); $content = $title . ' <br>[来自应用 <a href="' . WindUrlHelper::createUrl('app/dongta/index/run') . '">动他一下</a>]'; foreach ($users as $key => $value) { $dm = new App_Dongta_Dm(); $dm->setAct($act)->setTouid($value['uid'])->setCreatedUser($this->loginUser->uid, $this->loginUser->username)->setCreatedTime(Pw::getTime()); $service->add($dm); Wekit::load('message.srv.PwNoticeService')->sendNotice($value['uid'], 'app', 0, array('title' => $title, 'content' => $content)); } $this->showMessage('operate.success'); }
public function run() { $permissionService = new PwPermissionService(); $categorys = $permissionService->getPermissionPoint($this->_getShowPoint(), array('basic', 'bbs')); $compare = $this->getInput('gid'); if ($compare && $compare != $this->loginUser->gid) { $this->setOutput(true, 'compare'); $compareGroup = $permissionService->getPermissionConfigByGid($compare, $this->_getShowPoint()); $this->setOutput($compareGroup, 'compareGroupPermission'); $this->setOutput($compare, 'comparegid'); } $myGroup = $permissionService->getPermissionConfigByGid($this->loginUser->gid, $this->_getShowPoint()); $this->listGroups(); $attach = array('allow_upload', 'allow_download', 'uploads_perday'); foreach ($categorys['bbs']['sub'] as $_k => $_v) { if (!in_array($_v, $attach)) { continue; } unset($categorys['bbs']['sub'][$_k]); } $totalCredit = Wekit::load('usergroup.srv.PwUserGroupsService')->getCredit($this->loginUser->info); $categorys['attach'] = array('name' => '附件权限', 'sub' => $attach); $this->setOutput($categorys, 'categorys'); $this->setOutput($myGroup, 'myGroupPermission'); $this->setOutput($totalCredit, 'myCredit'); $this->_appendBread('权限查看', WindUrlHelper::createUrl('profile/right/run')); $this->setTemplate('profile_right'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $seoBo = PwSeoBo::getInstance(); $lang = Wind::getComponent('i18n'); $seoBo->setCustomSeo($lang->getMessage('SEO:profile.right.run.title'), '', ''); Wekit::setV('seo', $seoBo); }
public function getNotice($adminUser) { $notice = 0; $upgradeInfo = $patchInfo = array(); if (Wekit::load('ADMIN:service.srv.AdminFounderService')->isFounder($adminUser->username)) { $upgradeInfo = $this->checkUpgrade(); $upgradeInfo && is_array($upgradeInfo) && ($notice |= 1); $patchInfo = Wekit::load('APPS:appcenter.service.srv.PwPatchUpdate')->checkUpgrade(); $patchInfo && is_array($patchInfo) && ($notice |= 2); } $url = ''; switch ($notice) { case 1: $notice = '您正在使用旧版本的phpwind,为了获得更好的体验,请升级至最新版。'; $url = WindUrlHelper::createUrl('appcenter/upgrade/run'); break; case 2: $notice = '您正在使用的版本有更新补丁,请安装补丁。'; $url = WindUrlHelper::createUrl('appcenter/fixup/run'); break; case 3: $notice = '您正在使用的版本有新增升级包和更新补丁。'; $url = WindUrlHelper::createUrl('appcenter/upgrade/run'); break; default: $notice = ''; } return array('notice' => $notice, 'url' => $url, 'info' => array($patchInfo, $upgradeInfo)); }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); if (!$this->loginUser->isExists()) { $this->forwardAction('u/login/run',array('backurl' => WindUrlHelper::createUrl('my/follow/run'))); } $this->setOutput('follow', 'li'); }
public function getNotice($loginUser) { $notice = 0; $upgradeInfo = $patchInfo = array(); if (Wekit::load('ADMIN:service.srv.AdminFounderService')->isFounder($loginUser->username)) { $upgradeInfo = $this->checkUpgrade(); $upgradeInfo && is_array($upgradeInfo) && ($notice |= 1); $patchInfo = Wekit::load('APPCENTER:service.srv.PwPatchUpdate')->checkUpgrade(); $patchInfo && is_array($patchInfo) && ($notice |= 2); } $url = ''; $f = '<a data-level="2" data-parent="%s" data-id="%s" href="%s" class="J_tabframe_trigger">立即升级</a>'; switch ($notice) { case 1: $notice = '您正在使用旧版本的phpwind,为了获得更好的体验,请升级至最新版。'; $url = WindUrlHelper::createUrl('appcenter/upgrade/run'); break; case 2: $notice = '您正在使用的版本有更新补丁,请安装补丁。'; $url = WindUrlHelper::createUrl('appcenter/fixup/run'); break; case 3: $notice = '您正在使用的版本有新增升级包和更新补丁。'; $url = WindUrlHelper::createUrl('appcenter/upgrade/run'); break; default: $notice = ''; } return array('notice' => $notice . ($url ? sprintf($f, 'platform', 'platform_upgrade', $url) : ''), 'info' => array($patchInfo, $upgradeInfo)); }
public function __construct() { parent::__construct(); $config = Wekit::C('pay'); $this->paypal = $config['paypal']; $this->paypal_key = $config['paypalkey']; $this->baseurl = WindUrlHelper::createUrl('bbs/paypal/run'); }
public function beforeAction($handlerAdapter) { $this->appid = $this->getInput('appid'); parent::beforeAction($handlerAdapter); if (!$this->loginUser->isExists()) { $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('appcenter/app/run', array('appid' => $this->appid)))); } }
/** * 构建输出数据格式 * * @param array $data * @param string $var 传递给用户的参数 * @return array */ private function buildList($data, $var = '') { $return = array(); foreach ($data as $key => $item) { $return[$key] = array('title' => $item['title'], 'var' => $var, 'url' => $item['setting_url'] ? WindUrlHelper::createUrl($item['setting_url']) : ''); } return $return; }
public function run() { $keywords = $this->getInput('keyword'); if (!Wekit::C('site', 'search.isopen')) { $this->forwardRedirect(WindUrlHelper::createUrl('search/search/run', array('keyword' => $keywords))); } $this->forwardAction('app/index/run?app=search', array('keywords' => $keywords)); }
public function beforeAction($handlerAdapter) { // parent::beforeAction(); $this->__custom_init(); if ($this->uid < 1) { $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('app/nanatools/process/run'))); } // dump($this); }
/** * 此方法暂时没用 */ public function myAction() { if ($this->loginUser->uid < 1) { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run', array('backurl' => WindUrlHelper::createUrl('tag/index/my')))); } $typeName = $this->defaultType; /* list($page) = $this->getInput(array('page')); $page = $page ? $page : 1; list($start, $limit) = Pw::page2limit($page, $this->attentionTagList);*/ $tagServicer = $this->_getTagService(); //获取我关注的话题列表 $myTagsCount = $this->_getTagAttentionDs()->countAttentionByUid($this->loginUser->uid); if ($myTagsCount) { $relations = $this->_getTagDs()->getAttentionByUid($this->loginUser->uid, 0, 50); $relationTagIds = array_keys($relations); $myTagList = array_slice($relationTagIds, 0, 10); $myTagsList = $this->_getTagDs()->fetchTag($relationTagIds); $tmpArray = array(); foreach ($myTagList as $v) { $tmpArray[$v] = $myTagsList[$v]; } $myTags['tags'] = $tmpArray; $myTags['step'] = $myTagsCount > $this->attentionTagList ? 2 : ''; $ifcheck = !$this->_checkAllowManage() ? 1 : ''; $tagContents = $params = $relatedTags = array(); $tmpTagContent = $myTags['tags'] ? array_slice($myTags['tags'], 0, 5, true) : array(); foreach ($tmpTagContent as $k => $v) { $contents = $tagServicer->getContentsByTypeName($k, $typeName, $ifcheck, 0, $this->hotContents); // var_dump($contents);exit; if ($contents) { $tagContents[$k] = $contents; foreach ($contents as $k2 => $v2) { $params[] = $k2; } } } $moreTags = array_diff_key($myTagsList, $tagContents); $params and $relatedTags = $tagServicer->getRelatedTags($typeName, $params); } //热门话题 $this->_setHotTagList($tagServicer->getHotTags(0, 20)); $this->setOutput($tagContents, 'tagContents'); // var_dump($relatedTags);exit; $this->setOutput($relatedTags, 'relatedTags'); $this->setOutput($myTags, 'myTags'); $this->setOutput($moreTags, 'moreTags'); $this->setOutput($myTagsList, 'myTagsList'); $this->setOutput($myTagsCount, 'myTagsCount'); //$this->setOutput($page, 'page'); //$this->setOutput($this->perpage, 'perpage'); // seo设置 Wind::import('SRV:seo.bo.PwSeoBo'); $seoBo = PwSeoBo::getInstance(); $lang = Wind::getComponent('i18n'); $seoBo->setCustomSeo($lang->getMessage('SEO:tag.index.my.title'), '', ''); Wekit::setV('seo', $seoBo); }
private function receiveEvent($object) { $contentStr = ""; $defaultUrl = WindUrlHelper::createUrl('app/4tmobile/mobileschool/run', array('openid' => $object->FromUserName)); switch ($object->Event) { case "subscribe": if (!empty($object->EventKey)) { //是从场景关注过来的 $key = $object->EventKey; //判断是否是首次关注 if (strpos($key, 'qrscene_') >= 0) { $key = str_replace('qrscene_', '', $key); } //now, the key shall be shopid $resultStr = $this->transmitText($object, 'shopid' . $key); break; } $contentStr = "/:rose欢迎关注点餐哟--您口袋里的外卖天堂!" . "\n" . "各大高校在线点餐火热进行中/:,@-D" . "\n" . "现在就开始体验吧~<a href=" . "'" . $defaultUrl . "'" . ">[开始点餐]</a>" . "\n" . "有任何意见和建议,都可以给小点留言哦,小点会亲自查看的/::\$"; $resultStr = $this->transmitText($object, $contentStr); break; case "unsubscribe": $contentStr = ""; break; case "CLICK": switch ($object->EventKey) { case "CLICK_ONLINE_ORDER": $contentStr = "<a href=" . "'" . $defaultUrl . "'" . ">[开始点餐]</a>"; $curSchool = $this->getCurrentSchoolByKey($object->FromUserName); if (empty($curSchool) == false) { $curSchool['url'] = WindUrlHelper::createUrl('app/4tmobile/mobileshop/run', array('openid' => $object->FromUserName, 'schoolid' => $curSchool['schoolid'])); $contentStr = "/:X-)我们猜您在" . "\n" . "<a href=" . "'" . $curSchool['url'] . "'" . ">" . $curSchool['name'] . "</a>" . "\n" . "/:@x不对?" . "\n" . "<a href=" . "'" . $defaultUrl . "'" . ">[查看全部区域]</a>"; } $resultStr = $this->transmitText($object, $contentStr); break; case "CLICK_MY_ORDER": // $schoolid, $days, $myid, $offset, $limit $contentStr = "您还没有在点餐哟下过订单哦,赶紧来试一试吧!" . "\n" . "马上<a href=" . "'" . $defaultUrl . "'" . ">[开始点餐]</a>"; $user = $this->getCurrentUserByKey($object->FromUserName); if (empty($user) == false) { $curSchool = $this->getCurrentSchoolByKey($object->FromUserName); $myOrderUrl = WindUrlHelper::createUrl('app/4tmobile/mobileorder/run', array('schoolid' => $curSchool['schoolid'], 'days' => 30, 'userid' => $user['userid'], 'openid' => $object->FromUserName)); $contentStr = "<a href=" . "'" . $myOrderUrl . "'" . ">/:heart亲,查看订单点这里~</a>"; } $resultStr = $this->transmitText($object, $contentStr); break; default: $contentStr = "你点击了菜单: " . $object->EventKey; $resultStr = $this->transmitText($object, $contentStr); break; } break; default: $contentStr = "receive a new event: " . $object->Event; break; } return $resultStr; }
public function run() { $schoolId = $this->getCurrentSchoolId(); $extras = $this->_getSchoolDS()->getSchoolExtra($schoolId); if ($extras[0]['opened']) { $this->forwardRedirect(WindUrlHelper::createUrl('app/4tschool/index/run?schoolid=' . $schoolId)); } $this->setOutput($schoolId, "schoolId"); }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); if (!$this->loginUser->isExists()) { $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('my/article/run'))); } if (!$this->loginUser->getPermission('allow_report')) { $this->showError(array('report.allow', array('{grouptitle}' => $this->loginUser->getGroupInfo('name')))); } }
/** * 设置安全问题 */ public function questionAction() { /* @var $userSrv PwUserService */ $userSrv = Wekit::load('SRV:user.srv.PwUserService'); $this->setCurrentLeft('password'); $this->setOutput($userSrv->isSetSafecv($this->loginUser->uid), 'isSetSafeQ'); $this->setOutput(PwUserHelper::getSafeQuestion(), 'safeQuestionList'); $this->appendBread('安全问题设置', WindUrlHelper::createUrl('profile/password/question')); $this->setTemplate('profile_question'); }
/** * 显示错误 * * @param string $error 消息信息 * @param string $referer 跳转地址 * @param boolean $referer 是否刷新页面 */ protected function showError($error = '', $referer = '', $refresh = false) { if ($referer) { $_referer = explode('#', $referer, 2); $referer = WindUrlHelper::createUrl($_referer[0], array(), isset($_referer[1]) ? $_referer[1] : ''); } $this->addMessage($referer, 'referer'); $this->addMessage($refresh, 'refresh'); parent::showMessage($error); }