Example #1
0
 protected function xmlFormat($moduleId)
 {
     Wind::import('SRV:design.bo.PwDesignModuleBo');
     $bo = new PwDesignModuleBo($moduleId);
     $module = $bo->getModule();
     if ($module['module_type'] != PwDesignModule::TYPE_SCRIPT) {
         exit('fail');
     }
     $data = $bo->getData(true);
     $dom = new DOMDocument('1.0', 'utf-8');
     $root = $dom->createElement('root');
     $dom->appendChild($root);
     foreach ($data as $v) {
         $child = $dom->createElement('data');
         foreach ((array) $v as $_k => $_v) {
             $_v = WindSecurity::escapeHTML($_v);
             $_k = $dom->createElement($_k);
             $_k->appendChild($dom->createTextNode($_v));
             $child->appendChild($_k);
             $root->appendChild($child);
         }
     }
     header('Content-type: application/xml');
     echo $dom->saveXML();
     exit;
 }
Example #2
0
 public function displayContent($content, $useubb, $remindUser = array(), $contentLength = 140)
 {
     $content = WindSecurity::escapeHTML($content);
     if ($useubb) {
         $ubb = new PwUbbCodeConvertThread();
         $ubb->setRemindUser($remindUser);
         $content = PwSimpleUbbCode::convert($content, $contentLength, $ubb);
     } else {
         $content = Pw::substrs($content, $contentLength);
     }
     return $content;
 }
 private function _getNewReply($pid, $limit)
 {
     $reply = Wekit::load('forum.PwThread')->getPost($pid);
     $total = $reply['replies'];
     Wind::import('LIB:ubb.PwSimpleUbbCode');
     Wind::import('LIB:ubb.config.PwUbbCodeConvertThread');
     $replydb = Wekit::load('forum.PwPostsReply')->getPostByPid($pid, $limit);
     foreach ($replydb as $key => $value) {
         $value['content'] = WindSecurity::escapeHTML($value['content']);
         if ($value['useubb']) {
             $value['content'] = PwSimpleUbbCode::convert($value['content'], 140, new PwUbbCodeConvertThread());
         } else {
             $value['content'] = Pw::substrs($value['content'], 140);
         }
         $replydb[$key] = $value;
     }
     return $replydb;
 }
Example #4
0
 public function dataAction()
 {
     $cron = false;
     $_data = array();
     $page = (int) $this->getInput('page', 'get');
     $pageid = (int) $this->getInput('pageid', 'get');
     $moduleid = (int) $this->getInput('moduleid', 'get');
     $start = (int) $this->getInput('start', 'get');
     $start >= 100 && ($start = 100);
     $module = Wekit::load('design.PwDesignModule')->getModule($moduleid);
     $perpage = 20;
     if (!$module) {
         $this->showMessage("operate.fail");
     }
     //返回成功信息
     $time = Pw::getTime();
     Wind::import('SRV:design.bo.PwDesignPageBo');
     $pageBo = new PwDesignPageBo();
     $ds = Wekit::load('design.PwDesignData');
     $vo = Wekit::load('design.srv.vo.PwDesignDataSo');
     $vo->setModuleId($moduleid);
     $vo->setReservation(0);
     $vo->orderbyViewOrder(true);
     $vo->orderbyDataid(true);
     $data = $ds->searchData($vo, $perpage, $start);
     $this->_getLikeContentService();
     foreach ($data as $k => $v) {
         $_data[$k] = unserialize($v['extend_info']);
         $_data[$k]['fromtype'] = $v['from_app'] == 'thread' ? PwLikeContent::THREAD : 0;
         $_data[$k]['fromid'] = $v['from_id'];
         if ($v['end_time'] > 0 && $v['end_time'] < $time) {
             $cron = true;
         }
         foreach ($_data[$k] as $_k => $_v) {
             $_data[$k][$_k] = WindSecurity::escapeHTML($_v);
         }
     }
     if ($cron || count($data) < 1) {
         $pageBo->updateDesignCron(array($moduleid));
     }
     $this->setOutput($_data, 'data');
     $this->showMessage('operate.success');
 }
Example #5
0
 protected function _bulidContent($array, &$errcode)
 {
     $errcode = array();
     $array['content'] = str_replace(array("\r", "\n", "\t"), '', $array['content']);
     $array['content'] = WindSecurity::escapeHTML($array['content']);
     if ($array['ifshield']) {
         $array['subject'] = '';
         $array['content'] = '<span style="text-decoration: line-through">此帖已被屏蔽</span>';
     } elseif ($array['useubb']) {
         $ubb = new PwUbbCodeConvertThread();
         $array['reminds'] && $ubb->setRemindUser($array['reminds']);
         $array['pic'] && $ubb->setAttachParser(new PwFreshAttachDisplay($array['pic']));
         $array['content'] = PwSimpleUbbCode::convert($array['content'], 140, $ubb);
         PwSimpleUbbCode::isSubstr() && ($errcode['is_read_all'] = true);
     } elseif (Pw::strlen($array['content']) > 140) {
         $errcode['is_read_all'] = true;
         $array['content'] = Pw::substrs($array['content'], 140);
     }
     return $array;
 }
Example #6
0
 /**
  * 组装可执行的table
  * 
  * @param array $tables
  * @return tables table1,table2,table3
  */
 private function _buildTables($tables)
 {
     if (!$tables) {
         return false;
     }
     !is_array($tables) && ($tables = array($tables));
     $tables = array_unique($tables);
     $table = '';
     foreach ($tables as $v) {
         $v = WindSecurity::escapeHTML($v);
         $v && ($table .= `{$v}`);
     }
     return $table ? $table : false;
 }
Example #7
0
 public function dataAction()
 {
     $page = (int) $this->getInput('page', 'get');
     $start = (int) $this->getInput('start', 'get');
     $start >= 100 && ($start = 100);
     $perpage = 20;
     $_data = array();
     $logLists = $this->_getBuildLikeService()->getFollowLogList($this->loginUser->uid, $start, $perpage);
     $likeLists = $this->_getBuildLikeService()->getLikeList();
     $likeInfos = $this->_getBuildLikeService()->getLikeInfo();
     $replyInfos = $this->_getBuildLikeService()->getLastReplyInfo();
     foreach ($logLists as $k => $logList) {
         if (!isset($likeInfos[$logList['likeid']])) {
             continue;
         }
         $_data[$k]['fromid'] = $likeLists[$logList['likeid']]['fromid'];
         $_data[$k]['fromtype'] = $likeLists[$logList['likeid']]['typeid'];
         $_data[$k]['url'] = $likeInfos[$logList['likeid']]['url'];
         $_data[$k]['image'] = $likeInfos[$logList['likeid']]['image'];
         $_data[$k]['subject'] = WindSecurity::escapeHTML($likeInfos[$logList['likeid']]['subject']);
         $_data[$k]['descrip'] = WindSecurity::escapeHTML(strip_tags($likeInfos[$logList['likeid']]['content']));
         $_data[$k]['uid'] = $likeInfos[$logList['likeid']]['uid'];
         $_data[$k]['username'] = $likeInfos[$logList['likeid']]['username'];
         $_data[$k]['avatar'] = Pw::getAvatar($likeInfos[$logList['likeid']]['uid'], 'small');
         $_data[$k]['space'] = WindUrlHelper::createUrl('space/index/run/?uid=' . $likeInfos[$logList['likeid']]['uid']);
         $_data[$k]['lasttime'] = Pw::time2str($likeInfos[$logList['likeid']]['lasttime'], 'auto');
         $_data[$k]['like_count'] = $likeInfos[$logList['likeid']]['like_count'];
         $_data[$k]['reply_pid'] = $replyInfos[$likeLists[$logList['likeid']]['reply_pid']];
         $_data[$k]['reply_uid'] = $replyInfos[$likeLists[$logList['likeid']]['reply_pid']]['uid'];
         $_data[$k]['reply_avatar'] = Pw::getAvatar($replyInfos[$likeLists[$logList['likeid']]['reply_pid']]['uid'], 'small');
         $_data[$k]['reply_space'] = WindUrlHelper::createUrl('space/index/run/?uid=' . $replyInfos[$likeLists[$logList['likeid']]['reply_pid']]['uid']);
         $_data[$k]['reply_username'] = $replyInfos[$likeLists[$logList['likeid']]['reply_pid']]['username'];
         $_data[$k]['reply_content'] = WindSecurity::escapeHTML($replyInfos[$likeLists[$logList['likeid']]['reply_pid']]['content']);
         $_data[$k]['like_url'] = WindUrlHelper::createUrl('like/mylike/doLike/?typeid=' . $_data[$k]['fromtype'] . '&fromid=' . $_data[$k]['fromid']);
     }
     $this->setOutput($_data, 'data');
     $this->showMessage('operate.success');
 }
Example #8
0
 public function doeditAction()
 {
     $array = array();
     $html = '';
     $title = $this->getInput('title', 'post');
     $link = $this->getInput('link', 'post');
     $image = $this->getInput('image', 'post');
     $float = $this->getInput('float', 'post');
     $margin = $this->getInput('margin', 'post');
     //$position = $this->getInput('position','post');
     //$pixels = $this->getInput('pixels','post');
     $fontsize = $this->getInput('fontsize', 'post');
     $fontcolor = $this->getInput('fontcolor', 'post');
     $fontbold = $this->getInput('fontbold', 'post');
     $fontunderline = $this->getInput('fontunderline', 'post');
     $fontitalic = $this->getInput('fontitalic', 'post');
     $bgimage = $this->getInput('bgimage', 'post');
     $bgcolor = $this->getInput('bgcolor', 'post');
     $bgposition = $this->getInput('bgposition', 'post');
     $styleSrv = $this->_getStyleService();
     $background = array();
     $bgimage && ($background['image'] = $bgimage);
     $bgcolor && ($background['color'] = $bgcolor);
     $bgposition && ($background['position'] = $bgposition);
     //foreach ($pixels AS &$v) $v = (int)$v ? (int)$v: '';
     foreach ($fontsize as &$v) {
         $v = (int) $v ? (int) $v : '';
     }
     foreach ($title as $k => $value) {
         $_tmp = array('title' => $title[$k], 'link' => $link[$k], 'image' => $image[$k], 'float' => $float[$k], 'margin' => $margin[$k], 'fontsize' => $fontsize[$k], 'fontcolor' => $fontcolor[$k], 'fontbold' => $fontbold[$k], 'fontunderline' => $fontunderline[$k], 'fontitalic' => $fontitalic[$k]);
         $style = $this->_buildTitleStyle($_tmp);
         $styleSrv->setStyle($style);
         list($dom, $jstyle) = $styleSrv->getCss($style);
         $jtitle = $image[$k] ? '<img src="' . $_tmp['image'] . '" title="' . WindSecurity::escapeHTML($_tmp['title']) . '">' : WindSecurity::escapeHTML($_tmp['title']);
         if ($jtitle) {
             $html .= '<span ';
             $html .= $jstyle ? 'style="' . $jstyle . '"' : '';
             $html .= '>';
             $html .= $_tmp['link'] ? '<a href="' . $_tmp['link'] . '">' : '';
             $html .= $jtitle;
             $html .= $_tmp['link'] ? '</a>' : '';
             $html .= '</span>';
             $array['titles'][] = $_tmp;
         }
     }
     if ($background) {
         $array['background'] = $background;
         $bg = array('background' => $background);
         $styleSrv->setStyle($bg);
         list($dom, $data['background']) = $styleSrv->getCss();
     }
     $bgStyle = $data['background'] ? '  style="' . $data['background'] . '"' : '';
     if ($html) {
         $html = '<h2 class="cc design_tmode_h2"' . $bgStyle . '>' . $html . '</h2>';
     }
     Wind::import('SRV:design.dm.PwDesignModuleDm');
     $dm = new PwDesignModuleDm($this->bo->moduleid);
     $dm->setTitle($array);
     $resource = $this->_getModuleDs()->updateModule($dm);
     if ($resource instanceof PwError) {
         $this->showError($resource->getError());
     }
     $this->setOutput($html, 'html');
     $this->showMessage("operate.success");
 }
Example #9
0
 public function analyse($attach)
 {
     if ($attach['type'] == 'img' && $attach['cost'] == 0) {
         $atype = 'pic';
         $url = Pw::getPath($attach['path']);
         $img = PwUbbCode::createImg(Pw::getPath($attach['path'], $attach['ifthumb'] & 1), $this->imgWidth, $this->imgHeight, $url, $this->imgLazy);
         $attr = '';
         if ($this->imgLazy && ($tmp = $this->_compare($attach['width'], $attach['height'], $this->imgWidth, $this->imgHeight))) {
             $attr .= ' width="' . $tmp[0] . '"';
             $attr .= ' height="' . $tmp[1] . '"';
         }
         $attach['descrip'] && ($attr .= ' alt="' . WindSecurity::escapeHTML($attach['descrip']) . '"');
         $attr && ($img = substr($img, 0, -3) . $attr . ' />');
         $attach += array('url' => $url, 'img' => $img, 'miniUrl' => Pw::getPath($attach['path'], $attach['ifthumb']));
     } else {
         $atype = 'downattach';
         $attach += array('cname' => '', 'ext' => strtolower(substr(strrchr($attach['name'], '.'), 1)));
     }
     return array($atype, $attach);
 }
Example #10
0
 /**
  * 将数组简易地转换成json格式
  *
  * @param array $var
  * @return string
  */
 public static function array2str($var)
 {
     if (empty($var) || !is_array($var)) {
         return '{}';
     }
     $str = '';
     foreach ($var as $k => $v) {
         $str .= "'" . WindSecurity::escapeHTML($k) . "' : " . (is_array($v) ? self::array2str($v) : "'" . WindSecurity::escapeHTML($v) . "'") . ",";
     }
     return '{' . rtrim($str, ',') . '}';
 }
Example #11
0
 /**
  * 阅读更多
  * 
  */
 public function readAction()
 {
     Wind::import('SRV:forum.bo.PwThreadBo');
     $id = (int) $this->getInput('id');
     $fresh = Wekit::load('attention.PwFresh')->getFresh($id);
     if ($fresh['type'] == 1) {
         $thread = new PwThreadBo($fresh['src_id']);
         $array = $thread->info;
         $array['pid'] = 0;
     } else {
         $array = Wekit::load('forum.PwThread')->getPost($fresh['src_id']);
         $thread = new PwThreadBo($array['tid']);
     }
     Wind::import('LIB:ubb.PwUbbCode');
     Wind::import('LIB:ubb.config.PwUbbCodeConvertThread');
     $array['content'] = WindSecurity::escapeHTML($array['content']);
     $array['content'] = str_replace("\n", '<br />', $array['content']);
     $array['useubb'] && ($array['content'] = PwUbbCode::convert($array['content'], new PwUbbCodeConvertThread($thread, $array, $this->loginUser)));
     echo $array['content'];
     $this->setTemplate('');
 }
Example #12
0
 public function readAction()
 {
     Wind::import('SRV:forum.bo.PwThreadBo');
     $id = $this->getInput('id');
     $fresh = $this->_getService()->getFresh($id);
     if ($fresh['type'] == 1) {
         $thread = new PwThreadBo($fresh['src_id']);
         $array = $thread->info;
         $array['pid'] = 0;
     } else {
         $array = $this->_getThread()->getPost($fresh['src_id']);
         $thread = new PwThreadBo($array['tid']);
     }
     Wind::import('LIB:ubb.PwUbbCode');
     Wind::import('LIB:ubb.config.PwUbbCodeConvertThread');
     $array['content'] = WindSecurity::escapeHTML($array['content']);
     $array['content'] = str_replace("\n", '<br />', $array['content']);
     $array['useubb'] && ($array['content'] = PwUbbCode::convert($array['content'], new PwUbbCodeConvertThread($thread, $array, $this->loginUser)));
     echo $array['content'];
     $this->setTemplate('');
     //$this->setOutPut($array['content'], 'data');
     //$this->showMessage('success');
 }
 /**
  * 获取积分类型
  * 
  * @return type
  */
 public function getRewardCreditType()
 {
     $creditType = $this->_getReplyRewardConfigService()->getReplyRewardCreditType();
     foreach ($this->_getCreditBoInstance()->cType as $key => $value) {
         if (!in_array($key, $creditType)) {
             continue;
         }
         $replyrewardcredit .= "<option value=\"{$key}\">" . WindSecurity::escapeHTML($value) . "</option>";
     }
     echo $replyrewardcredit;
 }
Example #14
0
 public function getForumListForHeadTopic($groupid, $currentFid = 0, $currentCategory = false)
 {
     $sub1 = $sub2 = $forumdb = array();
     $forums = $this->_getForumDs()->getForumList();
     if ($currentCategory) {
         $category = $this->_getCategoryByFid($currentFid, $forums);
     }
     foreach ($forums as $v) {
         if ($v['isshow'] || !$v['isshow'] && strpos($v['allowvisit'], ',' . $groupid . ',') !== false) {
             $v['fid'] == $currentFid && ($currentForum = $v);
             if ($v['type'] == 'category') {
                 if ($currentCategory && $category != $v['fid']) {
                     continue;
                 }
                 $catedb[] = $v;
             } elseif ($v['type'] == 'forum') {
                 $forumdb[$v['parentid']] || ($forumdb[$v['parentid']] = array());
                 $forumdb[$v['parentid']][] = $v;
             } elseif ($v['type'] == 'sub') {
                 $sub1[$v['parentid']] || ($sub1[$v['parentid']] = array());
                 $sub1[$v['parentid']][] = $v;
             } else {
                 $sub2[$v['parentid']] || ($sub2[$v['parentid']] = array());
                 $sub2[$v['parentid']][] = $v;
             }
         }
     }
     $top_3 = $top_2 = $top_1 = $catedbs = array();
     foreach ((array) $catedb as $k1 => $v1) {
         $catedbs[$v1['fid']] = array();
         foreach ((array) $forumdb[$v1['fid']] as $k2 => $v2) {
             $catedbs[$v1['fid']][] = $v2['fid'];
             foreach ((array) $sub1[$v2['fid']] as $k3 => $v3) {
                 $catedbs[$v1['fid']][] = $v3['fid'];
                 foreach ((array) $sub2[$v3['fid']] as $k4 => $v4) {
                     $catedbs[$v1['fid']][] = $v4['fid'];
                 }
             }
         }
     }
     foreach ((array) $catedb as $k1 => $v1) {
         $v1['name'] = WindSecurity::escapeHTML(strip_tags($v1['name']));
         $top_3[$v1['fid']] = "&gt;&gt;" . $v1['name'];
         if (in_array($currentForum['fid'], $catedbs[$v1['fid']])) {
             $top_2[$v1['fid']] = "&gt;&gt;" . $v1['name'];
         }
         foreach ((array) $forumdb[$v1['fid']] as $k2 => $v2) {
             $v2['name'] = WindSecurity::escapeHTML(strip_tags($v2['name']));
             if ($v2['fid'] == $currentForum['fid']) {
                 $top_1[$v2['fid']] = "&nbsp;|-" . $v2['name'];
             }
             if (in_array($currentForum['fid'], $catedbs[$v1['fid']])) {
                 $top_2[$v2['fid']] = "&nbsp;|-" . $v2['name'];
             }
             $top_3[$v2['fid']] = "&nbsp;|-" . $v2['name'];
             if (!is_array($sub1[$v2['fid']])) {
                 continue;
             }
             foreach ((array) $sub1[$v2['fid']] as $k3 => $v3) {
                 $_subs = array();
                 $v3['name'] = WindSecurity::escapeHTML(strip_tags($v3['name']));
                 if ($v3['fid'] == $currentForum['fid']) {
                     $top_1[$v3['fid']] = "&nbsp;|-" . $v3['name'];
                 }
                 if ($v3['parentid'] == $currentForum['fid']) {
                     $_subs[] = $v3['fid'];
                     $top_1[$v3['fid']] = "&nbsp;&nbsp;&nbsp;|-" . $v3['name'];
                 }
                 $v1['fid'] == $currentForum['parentid'] && ($top_2[$v3['fid']] = "&nbsp;&nbsp;&nbsp;|-" . $v3['name']);
                 if (in_array($currentForum['fid'], $catedbs[$v1['fid']])) {
                     $top_2[$v3['fid']] = "&nbsp;&nbsp;&nbsp;|-" . $v3['name'];
                 }
                 $top_3[$v3['fid']] = "&nbsp;&nbsp;&nbsp;|-" . $v3['name'];
                 if (!is_array($sub2[$v3['fid']])) {
                     continue;
                 }
                 foreach ((array) $sub2[$v3['fid']] as $k4 => $v4) {
                     $v4['name'] = WindSecurity::escapeHTML(strip_tags($v4['name']));
                     if ($v4['fid'] == $currentForum['fid']) {
                         $top_1[$v4['fid']] = "&nbsp;|-" . $v4['name'];
                     }
                     if (in_array($v4['parentid'], $_subs)) {
                         $top_1[$v4['fid']] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|-" . $v4['name'];
                     }
                     if (in_array($currentForum['fid'], $catedbs[$v1['fid']])) {
                         $top_2[$v4['fid']] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|-" . $v4['name'];
                     }
                     $top_3[$v4['fid']] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|-" . $v4['name'];
                 }
             }
         }
     }
     return array($catedbs, $top_1, $top_2, $top_3);
 }
Example #15
0
 protected function headguide($protalname)
 {
     $bbsname = Wekit::C('site', 'info.name');
     $headguide = '<a href="' . WindUrlHelper::createUrl('') . '" title="' . $bbsname . '" class="home">首页</a>';
     return $headguide . '<em>&gt;</em>' . WindSecurity::escapeHTML($protalname);
 }
Example #16
0
 /**
  * 获取对话消息列表
  *
  * @param int $uid
  * @param int $from_uid
  * @param int $start
  * @param int $limit
  * @return array
  */
 public function getDialogMessageList($dialogId, $limit, $start)
 {
     // 对话消息分页
     $count = $this->_getWindid()->countMessage($dialogId);
     if (!$count) {
         return array(0, array());
     }
     $_messages = $this->_getWindid()->getMessageList($dialogId, $start, $limit);
     $messages = array();
     foreach ($_messages as $k => $v) {
         $v['content'] = WindSecurity::escapeHTML($v['content']);
         $messages[$k] = $v;
     }
     krsort($messages);
     return array($count, $messages);
 }
 protected function _bulidContent($content, $ubb, &$errcode)
 {
     $errcode = array();
     $content = str_replace(array("\r", "\n", "\t"), '', $content);
     $content = WindSecurity::escapeHTML($content);
     if ($ubb) {
         $content = PwSimpleUbbCode::convert($content, 140, new PwUbbCodeConvertThread());
         PwSimpleUbbCode::isSubstr() && ($errcode['is_read_all'] = true);
     } elseif (Pw::strlen($content) > 140) {
         $errcode['is_read_all'] = true;
         $content = Pw::substrs($content, 140);
     }
     //var_dump($content);
     //$content = WindSecurity::escapeHTML($content);
     //$content = preg_replace('/(?<!&|&amp;)#([^#]+?)#/ie', "self::_parseTopic('\\1')", $content);
     return $content;
 }
Example #18
0
 public function getTitleHtml()
 {
     $html = '';
     $titles = $this->getTitle();
     $styleSrv = Wekit::load('design.srv.PwDesignStyle');
     foreach ((array) $titles['titles'] as $k => $v) {
         $_tmp = array('title' => WindSecurity::escapeHTML($v['title']), 'link' => $v['link'], 'image' => $v['image'], 'float' => $v['float'], 'margin' => $v['margin'], 'fontsize' => $v['fontsize'], 'fontcolor' => $v['fontcolor'], 'fontbold' => $v['fontbold'], 'fontunderline' => $v['fontunderline'], 'fontitalic' => $v['fontitalic']);
         $style = $styleSrv->buildTitleStyle($_tmp);
         $styleSrv->setStyle($style);
         list($dom, $jstyle) = $styleSrv->getCss();
         $jtitle = $_tmp['image'] ? '<img src="' . $_tmp['image'] . '" title="' . $_tmp['title'] . '">' : $_tmp['title'];
         if ($jtitle) {
             $html .= '<span';
             $html .= $jstyle ? ' style="' . $jstyle . '"' : '';
             $html .= '>';
             $html .= $_tmp['link'] ? '<a href="' . $_tmp['link'] . '">' : '';
             $html .= $jtitle;
             $html .= $_tmp['link'] ? '</a>' : '';
             $html .= '</span>';
         }
     }
     if ($titles['background']) {
         $bg = array('background' => $titles['background']);
         $styleSrv->setStyle($bg);
         list($dom, $background) = $styleSrv->getCss();
     }
     $bgStyle = $background ? '  style="' . $background . '"' : '';
     if ($html) {
         $html = '<h2 class="cc design_tmode_h2"' . $bgStyle . '>' . $html . '</h2>';
     }
     return $html;
 }
Example #19
0
 /**
  * 拖拉模块标题修改
  * Enter description here ...
  */
 public function doedittitleAction()
 {
     $html = '';
     $array = array();
     $pageid = (int) $this->getInput('pageid', 'post');
     $title = $this->getInput('title', 'post');
     if ($pageid < 1) {
         $this->showError("permissions.fail");
     }
     $link = $this->getInput('link', 'post');
     $image = $this->getInput('image', 'post');
     $float = $this->getInput('float', 'post');
     $margin = $this->getInput('margin', 'post');
     $fontsize = $this->getInput('fontsize', 'post');
     $fontcolor = $this->getInput('fontcolor', 'post');
     $fontbold = $this->getInput('fontbold', 'post');
     $fontunderline = $this->getInput('fontunderline', 'post');
     $fontitalic = $this->getInput('fontitalic', 'post');
     $bgimage = $this->getInput('bgimage', 'post');
     $bgcolor = $this->getInput('bgcolor', 'post');
     $bgposition = $this->getInput('bgposition', 'post');
     $structure = $this->getInput('structure', 'post');
     $tab = $this->getInput('tab', 'post');
     $styleSrv = $this->_getStyleService();
     $_n = 0;
     foreach ($tab as $v) {
         if ($v) {
             list($t, $n) = explode('_', $v);
             if ($n >= $_n) {
                 $_n = $n + 1;
             }
         }
     }
     $background['image'] = $bgimage;
     $background['color'] = $bgcolor;
     $background['position'] = $bgposition;
     foreach ($title as $k => $value) {
         $_tmp = array('title' => WindSecurity::escapeHTML($title[$k]), 'link' => $link[$k], 'image' => $image[$k], 'float' => $float[$k], 'margin' => (int) $margin[$k], 'fontsize' => (int) $fontsize[$k], 'fontcolor' => $fontcolor[$k], 'fontbold' => $fontbold[$k], 'fontunderline' => $fontunderline[$k], 'fontitalic' => $fontitalic[$k]);
         $style = $this->_buildTitleStyle($_tmp);
         $styleSrv->setStyle($style);
         list($dom, $jstyle) = $styleSrv->getCss();
         $jtitle = $image[$k] ? '<img src="' . $_tmp['image'] . '" title="' . $_tmp['title'] . '">' : $_tmp['title'];
         if ($jtitle) {
             if ($structure == 'tab') {
                 if (!$tab[$k]) {
                     $tab[$k] = 'tab_' . $_n;
                     $_n++;
                 }
                 $html .= '<li role="tab">';
                 $html .= '<a data-id="' . $tab[$k] . '" href="' . $_tmp['link'] . '"';
                 $html .= $jstyle ? ' style="' . $jstyle . '"' : '';
                 $html .= '>';
                 $html .= $jtitle;
                 $html .= '</a>';
                 $html .= '</li>';
                 $_tmp['tab'] = $tab[$k];
             } else {
                 $html .= '<span';
                 $html .= $jstyle && !$_tmp['link'] ? ' style="' . $jstyle . '"' : '';
                 $html .= '>';
                 $html .= $_tmp['link'] ? '<a href="' . $_tmp['link'] . '" style="' . $jstyle . '">' : '';
                 $html .= $jtitle;
                 $html .= $_tmp['link'] ? '</a>' : '';
                 $html .= '</span>';
             }
             $array['titles'][] = $_tmp;
         }
     }
     $data['tab'] = $html;
     $data['tabName'] = $tab;
     if ($background) {
         $array['background'] = $background;
         $bg = array('background' => $background);
         $styleSrv->setStyle($bg);
         list($dom, $data['background']) = $styleSrv->getCss();
     }
     Wind::import('SRV:design.dm.PwDesignStructureDm');
     $dm = new PwDesignStructureDm();
     $style = $this->bo->getStyle();
     $dm->setStructTitle($array)->setStructname($this->bo->name)->setStructStyle($style['font'], $style['link'], $style['border'], $style['margin'], $style['padding'], $style['background'], $style['styleclass']);
     $resource = $this->_getStructureDs()->replaceStruct($dm);
     if ($resource instanceof PwError) {
         $this->showError($resource->getError());
     }
     $this->setOutput($data, 'data');
     $this->showMessage("operate.success");
 }
Example #20
0
File: Pw.php Project: healthguo/PHP
	/**
	 * 将HTML标签转义后输出JSON数据
	 *
	 * @param mixed $data
	 * @return void
	 */
	public static function echoJson($data) {
		echo self::jsonEncode(is_array($data) ? WindSecurity::escapeArrayHTML($data) : WindSecurity::escapeHTML($data));
	}
Example #21
0
 /**
  * 获得当前编码
  *
  * @return string
  */
 protected function _buildSecurity($content)
 {
     static $charset = '';
     if ($charset) {
         $charset = Wekit::V('charset') == 'GBK' ? 'ISO-8859-1' : Wekit::V('charset');
     }
     return WindSecurity::escapeHTML($content, $charset);
 }
Example #22
0
 protected function _bulidBbsSign($sign, $groupRight, $userstatus)
 {
     if (!$groupRight['allow_sign'] || Pw::getstatus($userstatus, PwUser::STATUS_BAN_SIGN)) {
         return '';
     }
     $sign = WindSecurity::escapeHTML($sign);
     if ($groupRight['sign_ubb'] && Pw::getstatus($userstatus, PwUser::STATUS_SIGN_USEUBB)) {
         $ubb = new PwUbbCodeConvertConfig();
         $ubb->isConverImg = $groupRight['sign_ubb_img'] ? true : false;
         $sign = PwUbbCode::convert($sign, $ubb);
     }
     return $sign;
 }
Example #23
0
 /**
  * 生成导航条节点信息
  *
  * @param array $guide 节点信息
  * @return string
  */
 public function bulidGuide($guide)
 {
     if ($guide[1]) {
         return '<em>&gt;</em><a href="' . $guide[1] . '">' . WindSecurity::escapeHTML($guide[0]) . '</a>';
     }
     return '<em>&gt;</em>' . WindSecurity::escapeHTML($guide[0]);
 }