Пример #1
0
function cs_shortcode_menu_render($atts)
{
    extract(shortcode_atts(array('title' => '', 'nav_menu' => '', 'el_class' => '', 'menu_align' => 'left', 'menu_line_height' => '80', 'css' => '', 'bg_image' => '', 'bg_color' => '', 'bg_image_repeat' => '', 'padding' => '', 'margin_bottom' => ''), $atts));
    ob_start();
    global $smof_data;
    $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'cs_custom_header_menu' . $el_class . $el_class . vc_shortcode_custom_css_class($css, ' '), 'cs-shortcode-menu', $atts);
    ?>
    <div id="menu" class="cs_mega_menu main-menu cs-menu-align-<?php 
    echo $menu_align;
    ?>
 cs-menu-line-height-<?php 
    echo $menu_line_height;
    ?>
 <?php 
    echo $css_class;
    ?>
">
		<div class="main-menu-content cshero-menu-dropdown clearfix nav-menu cshero-mobile">
			<?php 
    $menus = wp_get_nav_menus();
    if ($nav_menu) {
        echo '<ul class="cshero-dropdown main-menu">';
        wp_nav_menu(array('theme_location' => 'main_navigation', 'menu' => $nav_menu, 'depth' => 5, 'container' => false, 'menu_id' => 'nav', 'items_wrap' => '%3$s', 'walker' => new HeroMenuWalker()));
        if (is_active_sidebar('cshero-header-content-widget-1')) {
            ?>
                        <li>
                            <div class="header-cart-search">
                                <?php 
            if (!function_exists('dynamic_sidebar') || !dynamic_sidebar("Header Content Widget 1")) {
            }
            ?>
                            </div>
                        </li>
                        <?php 
        }
        if (isset($smof_data['enable_hidden_sidebar']) && $smof_data['enable_hidden_sidebar'] && !isMobile()) {
            ?>
                        <li>
                            <a href="#"><i class="fa fa-navicon cs_open"></i></a>
                        </li>
                        <?php 
        }
        echo '</ul>';
    } elseif (empty($menus)) {
        echo '<div class="menu-pages">';
        wp_nav_menu(array('depth' => 5, 'container' => false, 'menu_id' => 'nav', 'items_wrap' => '%3$s'));
        echo '</div>';
    } else {
        echo '<ul class="cshero-dropdown main-menu">';
        wp_nav_menu(array('depth' => 5, 'container' => false, 'menu_id' => 'nav', 'items_wrap' => '%3$s', 'walker' => new HeroMenuWalker()));
        echo '</ul>';
    }
    ?>
		</div>
	</div>
	<button type="button" class="btn btn-default btn-navbar navbar-toggle" data-toggle="collapse" data-target="#cshero-main-menu-mobile"><i class="fa fa-align-justify"></i></button>
	<div id="cshero-main-menu-mobile" class="collapse navbar-collapse cshero-mmenu"></div>
    <?php 
    return ob_get_clean();
}
Пример #2
0
 /**
  * Add common assign for simple mode on list page
  */
 function commonAssign()
 {
     parent::commonAssign();
     //search permissions
     $searchPermis = $this->permis[$this->tName]['search'];
     //export permissions
     $exportPermis = $this->permis[$this->tName]['export'];
     //add edit delete print export links
     $this->xt->assign("record_controls_block", $this->permis[$this->tName]['export'] || $this->permis[$this->tName]['add'] || $this->permis[$this->tName]['delete'] || $this->permis[$this->tName]['edit']);
     // adds style displat none to hiderecord controls, edit selected, delete selected, export selected and print selected if found 0 recs
     $this->xt->assign("details_block", $searchPermis && $this->rowsFound);
     if ($searchPermis && count($this->arrRecsPerPage) && ($this->rowsFound || $this->listAjax == LIST_AJAX)) {
         $this->xt->assign("recordspp_block", true);
         $this->createPerPage();
     }
     $this->xt->assign("pages_block", $searchPermis && $this->rowsFound);
     $this->xt->assign("pages_attrs", "id=\"pageOf" . $this->id . "\" name=\"pageOf" . $this->id . "\"");
     $this->xt->assign("shiftstyle_block", true);
     $this->xt->assign("left_block", true);
     //$this->xt->assign("toplinks_block", true);
     //export selected link and attr
     $this->xt->assign("exportselected_link", $exportPermis);
     $this->xt->assign("exportselectedlink_span", $this->buttonShowHideStyle());
     $this->xt->assign("exportselectedlink_attrs", $this->getPrintExportLinkAttrs('export'));
     // print links and attrs
     $this->xt->assign("prints_block", $exportPermis);
     $this->xt->assign("print_link", $exportPermis);
     $this->xt->assign("printlink_attrs", "id='print_" . $this->id . "' name='print_" . $this->id . "'");
     //print selected link and attr
     $this->xt->assign("printselected_link", $exportPermis);
     $this->xt->assign("printselectedlink_attrs", $this->getPrintExportLinkAttrs('print'));
     $this->xt->assign("printselectedlink_span", $this->buttonShowHideStyle());
     //print all link and attr
     $this->xt->assign("printall_link", $exportPermis);
     $this->xt->assign("printalllink_attrs", "id='printAll_" . $this->id . "' name='printAll_" . $this->id . "'");
     //export link and attr
     $this->xt->assign("export_link", $exportPermis);
     $this->xt->assign("exportlink_attrs", "id = 'export_" . $this->id . "'\r\n\t\t\t\t\t\t   name = 'export_" . $this->id . "'\r\n\t\t\t\t\t\t   onclick=\"window.open(this.href,'wExport');return false;\"");
     //add link and attr
     $this->xt->assign("add_link", $this->permis[$this->tName]['add']);
     $this->xt->assign("addlink_attrs", "href='" . $this->shortTableName . "_add.php' id=\"addButton" . $this->id . "\"");
     //advanced search and attr
     $this->xt->assign("advsearchlink_attrs", "id=\"advButton" . $this->id . "\"");
     //select all link and attr
     $this->selectAllLinkAttrs();
     //edit selected link and attr
     $this->editSelectedLinkAttrs();
     //save all link, attr, span
     $this->saveAllLinkAttrs();
     //cansel all link, attr, span
     $this->cancelAllLinkAttrs();
     $this->xt->assign("grid_block", true);
     $this->xt->assign('menu_block', $this->isShowMenu() || $this->isAdminTable());
     $this->xt->assign("languages_block", true);
     if (isMobile()) {
         $this->xt->assign('morelinkmobile_block', true);
         $this->xt->assign('tableinfomobile_block', true);
         $this->xt->displayBrickHidden("vmsearch2");
     }
 }
 function loadProductsListHtml($cat)
 {
     $args = array('post_type' => 'product', 'product_cat' => $cat, 'posts_per_page' => -1);
     $loop = new WP_Query($args);
     while ($loop->have_posts()) {
         $loop->the_post();
         global $product;
         $prod_html .= '<div class="product">';
         $prod_html .= $product->get_image('shop_single');
         $prod_html .= '<div class="product-info">';
         if (!isMobile()) {
             $prod_title = str_replace(" • ", "</br>", $product->get_title());
         } else {
             $prod_title = str_replace(" • ", " ", $product->get_title());
         }
         $prod_html .= '<h4>' . $prod_title . '</h4>';
         $prod_html .= '<p class="excerpt">' . $product->get_post_data()->post_excerpt . '</p>';
         $prod_html .= '<a class="more-info" href="' . $product->get_permalink() . '">Saiba mais</a>';
         //$prod_html.= '<div class="product-info-accordion">';
         //$prod_html.=mountAttributesAccordion($product->get_attributes(),$product->id);
         //$prod_html.= '</div><!--end product-info-accordion-->';
         $prod_html .= '</div><!--end product info-->';
         $prod_html .= '</div><!--end product-->';
     }
     echo $prod_html;
     wp_reset_postdata();
 }
Пример #4
0
 public function index()
 {
     $mobile = 13542147474;
     dump(isMobile($mobile));
     echo 1111;
     // $this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
 }
Пример #5
0
function songContainer($path, $title, $artist, $album, $length, $background, $class = "songContainer", $liked = 0)
{
    if (!$artist) {
        $artist = "Unknown";
    }
    if ($liked) {
        $title = " " . $title;
    }
    $tileTextSize = isMobile() ? 17 : 14;
    $tileTextSize .= "px;";
    $containerStyle = "background: {$background};";
    echo "<div data-path='{$path}' data-title='{$title}' data-artist='{$artist}' data-album='{$album}' data-length='{$length}' data-liked='{$liked}' class='{$class}' style='{$containerStyle}'>";
    if ($class == "songContainer") {
        echo "<div class='songInformation'>";
        if (!isMobile()) {
            echo "<div style='font-size: {$tileTextSize}'> <span class='songLength'>{$length}</span></div>";
        }
        echo "<div style='font-size: {$tileTextSize}'> <span class='songArtist'>{$artist}</span></div>";
        if ($album) {
            echo "<div style='font-size: {$tileTextSize}'> <span class='songAlbum'>{$album}</span></div>";
        }
        echo "<br> </div>";
    }
    echo "<div style='font-size: {$tileTextSize}'><span class='songTitle'>{$title}</span></div>";
    echo "</div>";
}
Пример #6
0
 public function getPhoneCode()
 {
     $mobile = I('mobile');
     //手机号码
     //验证手机号码格式
     if (!isMobile($mobile)) {
         $this->ajaxReturn(0, "手机号码格式错误", -1);
     }
     //判断手机号码是否存在
     if (M('user')->where(array('mobile' => $mobile))->count('id') == 0) {
         $this->ajaxReturn(0, "手机号码不存在", -2);
     }
     //发送短信验证码
     $mobileCode = createMoibleCode();
     if (sendMobileCode($mobile, '验证码:' . $mobileCode)) {
         session('mobile', $mobile);
         //注册手机号码传入session
         session('mobileCode', $mobileCode);
         //短信验证码传入session
         session('mobileCodeTime', time());
         //注册时间传入session
         $this->ajaxReturn(0, "操作成功", 1);
     } else {
         $this->ajaxReturn(0, "系统错误", -101);
     }
 }
Пример #7
0
 function buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data)
 {
     parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
     $nWidth = $this->pageObject->pSetEdit->getNCols($this->field);
     $nHeight = $this->pageObject->pSetEdit->getNRows($this->field);
     if ($this->pageObject->pSetEdit->isUseRTE($this->field)) {
         $value = $this->RTESafe($value);
         // creating src url
         $browser = "";
         if (@$_REQUEST["browser"] == "ie") {
             $browser = "&browser=ie";
         }
         // add JS code
         echo "<iframe frameborder=\"0\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" id=\"" . $this->cfield . "\" " . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? "alt=\"" . $this->strLabel . "\" " : "") . "name=\"" . $this->cfield . "\" title=\"Basic rich text editor\" style='";
         if (!isMobile()) {
             echo "width: " . ($nWidth + 1) . "px;";
         }
         echo "height: " . ($nHeight + 100) . "px;'";
         echo " src=\"" . GetTableLink("rte", "", "ptype=" . $this->pageObject->pageType . "&table=" . GetTableURL($this->pageObject->tName) . "&" . "id=" . $this->id . "&" . $this->iquery . $browser . "&" . ($mode == MODE_ADD || $mode == MODE_INLINE_ADD ? "action=add" : '')) . "\">";
         echo "</iframe>";
     } else {
         echo '<textarea id="' . $this->cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'name="' . $this->cfield . '" style="';
         if (!isMobile()) {
             echo "width: " . $nWidth . "px;";
         }
         echo 'height: ' . $nHeight . 'px;">' . runner_htmlspecialchars($value) . '</textarea>';
     }
     $this->buildControlEnd($validate);
 }
 public function _initialize()
 {
     if (isMobile()) {
         $this->redirect('index/Mobile/index?items_id =' . I('get.item_id'));
         return 0;
     }
 }
 public function _initialize()
 {
     if (isMobile()) {
         $this->redirect('Weixin/Jobs/pageJobs');
     }
     //验证是否为管理员登陆
     if (session('user')['adminname'] == "luobo") {
         session("user", null);
     }
     //定位城市
     $nowCity = session("nowCity");
     if (empty($nowCity)) {
         $nowCity = "威海市";
         session("nowCity", $nowCity);
         $ip = get_client_ip();
         if ($ip != "0.0.0.0") {
             $data = file_get_contents("http://ip.taobao.com/service/getIpInfo.php?ip=" . $ip);
             $data = json_decode($data, TRUE);
             if ($data['code'] == 0) {
                 $db = M("city");
                 $city = str_replace("市", "", $data['data']['city']);
                 $where['name'] = array('like', "%" . $city . "%");
                 $re = $db->where($where)->find();
                 if ($re) {
                     $nowCity = $re['name'];
                     session("nowCity", $nowCity);
                 }
             }
         }
     }
     $this->assign("nowCity", $nowCity);
     $sql = "SELECT * FROM job_level2 ORDER BY RAND()  LIMIT 5";
     $level2RandomList = M()->query($sql);
     $this->assign("level2RandomList", $level2RandomList);
 }
Пример #10
0
 function index_action()
 {
     if (isMobile()) {
         include template('project_m');
     } else {
         include template('project');
     }
 }
Пример #11
0
 /**
  * Remove mobile rendering from our custom non-forum pages.
  *
  * @param $sender
  */
 public function base_render_before($sender)
 {
     $userFacing = $sender->MasterView == 'default' || $sender->MasterView == '';
     $onForumPage = !in_array(strtolower($sender->Application), array('vanilla', 'conversations', 'dashboard'));
     if ($userFacing && isMobile() && $onForumPage) {
         // Use the main theme instead of mobile
         $sender->Theme = c('Garden.Theme');
         Gdn::pluginManager()->unregisterPlugin('MobileThemeHooks');
     }
 }
Пример #12
0
function isMobileForWordPress()
{
    global $isMobileDevice;
    if (isMobile()) {
        $isMobileDevice = 1;
    } else {
        $isMobileDevice = 0;
    }
    return $isMobileDevice;
}
Пример #13
0
 /**
  * 执行App控制器
  * @access public
  * @return void
  */
 public static function execApp()
 {
     //防止CSRF
     if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST' && stripos($_SERVER['HTTP_REFERER'], SITE_URL) !== 0 && $_SERVER['HTTP_USER_AGENT'] !== 'Shockwave Flash') {
         die('illegal request.');
     }
     // 使用手持设备时, 对用户的访问默认跳转至移动版, 除非用户指定访问普通版
     if ($_SESSION['wap_to_normal'] != '1' && cookie('wap_to_normal') != '1' && $_REQUEST['wap_to_normal'] != '1' && !isiPad()) {
         // 根据各应用的配置来判断是否存在手机版访问配置文件
         $publicAccess = array('message', 'register', 'feed');
         if (APP_NAME == 'public' && !in_array(strtolower(MODULE_NAME), $publicAccess) && strtolower(ACTION_NAME) != 'message' && isMobile() && in_array('wap', C('DEFAULT_APPS'))) {
             // 智能手机到3G版
             if (APP_NAME == 'public' && (isiPhone() || isAndroid())) {
                 // iOS和Android跳转至3G版
                 U('w3g/Index/index', '', true);
             } else {
                 // 其他手机跳转至WAP版
                 U('wap/Index/index', '', true);
             }
         }
     }
     // 加载所有插件
     if (C('APP_PLUGIN_ON')) {
         tsload(CORE_LIB_PATH . '/addons.class.php');
         tsload(CORE_LIB_PATH . '/addons/Hooks.class.php');
         tsload(CORE_LIB_PATH . '/addons/AbstractAddons.class.php');
         tsload(CORE_LIB_PATH . '/addons/NormalAddons.class.php');
         tsload(CORE_LIB_PATH . '/addons/SimpleAddons.class.php');
         tsload(CORE_LIB_PATH . '/addons/TagsAbstract.class.php');
         Addons::loadAllValidAddons();
     }
     //创建Action控制器实例
     $className = MODULE_NAME . 'Action';
     tsload(APP_ACTION_PATH . '/' . $className . '.class.php');
     if (!class_exists($className)) {
         $className = 'EmptyAction';
         tsload(APP_ACTION_PATH . '/EmptyAction.class.php');
         if (!class_exists($className)) {
             throw_exception(L('_MODULE_NOT_EXIST_') . ' ' . MODULE_NAME);
         }
     }
     $module = new $className();
     //异常处理
     if (!$module) {
         // 模块不存在 抛出异常
         throw_exception(L('_MODULE_NOT_EXIST_') . ' ' . MODULE_NAME);
     }
     //获取当前操作名
     $action = ACTION_NAME;
     //执行当前操作
     call_user_func(array(&$module, $action));
     //执行计划任务
     model('Schedule')->run();
     return;
 }
Пример #14
0
 public function webInit($mustSignin = false)
 {
     if (!isMobile()) {
         header('location:/index.php?s=/Index/Index');
         exit;
     }
     if (!session('wcInfo')) {
         $this->loginMode();
         //exit();
     }
 }
Пример #15
0
 function getCtrlParamsArr($fName, $recId, $fieldNum = 0, $value, $renderHidden = false, $isCached = true)
 {
     $control = parent::getCtrlParamsArr($fName, $recId, $fieldNum, $value, $renderHidden, $isCached);
     $control["params"]["additionalCtrlParams"]['skipDependencies'] = true;
     $control["params"]["additionalCtrlParams"]["style"] = isMobile() ? 'width: 35%;' : 'width: 115px;';
     $ctrlsMap = array('controls' => array());
     $ctrlsMap['controls']["skipDependencies"] = true;
     $ctrlsMap['controls']["style"] = isMobile() ? 'width: 35%;' : 'width: 115px;';
     $this->pageObj->fillControlsMap($ctrlsMap, true);
     return $control;
 }
Пример #16
0
 /**
  * Get controls attrs only for the Search panel
  * @param String fName 				The search field's name	
  * @param Number recId 				The search field row's Id
  * @param Number fieldNum 			The search field control's index (0 for the first, 1 for the second)
  * @param String value 				The search control's value
  * @param String opt 				The search control's search option
  * @param Boolean renderHidden 		Indicator showing if the search control is visible	
  * @param Boolean isCached 			Indicator showing if the search control is cached
  * @return Array
  */
 function getCtrlParamsArr($fName, $recId, $fieldNum, $value, $opt, $renderHidden = false, $isCached = true)
 {
     $parameters = parent::buildCtrlParamsArr($fName, $recId, $fieldNum, $value, $opt, $renderHidden, $isCached);
     $control = array();
     $parameters["additionalCtrlParams"]['skipDependencies'] = true;
     $parameters["additionalCtrlParams"]["searchPanelControl"] = true;
     $parameters["additionalCtrlParams"]["style"] = isMobile() ? 'width: 35%;' : 'width: 115px;';
     $ctrlsMap = $this->getExtraControlMap();
     $this->pageObj->fillControlsMap($ctrlsMap, true);
     AssignFunction($control, "xt_buildeditcontrol", $parameters);
     return $control;
 }
Пример #17
0
 public function saveSearchLog($CuisineID, $FoodTypeID, $Keyword, $Composition, $FoodProcess, $PriceRange, $EstPeople)
 {
     $browser = $this->getBrowser();
     $ip = $this->getRealUserIp();
     $device = 'Desktop';
     if (isMobile()) {
         $device = 'Mobile';
     }
     $resUserLog = $this->db->query('CALL InsertSearchLog(?,?,?,?,?,?,?,?,?,?,?,?,?)', array($CuisineID, $FoodTypeID, $Keyword, $Composition, $FoodProcess, $PriceRange, $EstPeople, $this->session->userdata('userid'), isset($browser['browser']) ? $browser['browser'] : false, isset($browser['version']) ? $browser['browser'] : false, !empty($ip) ? $ip : false, !empty($device) ? $device : false, isset($browser['os']) ? $browser['os'] : false));
     $query_result = $resUserLog->result();
     $resUserLog->next_result();
 }
 public function trace($url)
 {
     // session ( "access_trace_data", null);
     $ses = session("access_trace_data");
     if ($ses == null) {
         // 用户首次登录
         $data["session_id"] = session_id();
         $data["thedate"] = date("Y-m-d H:i:s", time());
         $data["url"] = $url;
         if (isMobile()) {
             $data["location"] = "手机";
         } else {
             $ipLocation = new \Org\Net\IpLocation('QQWry.dat');
             // 实例化类 参数表示IP地址库文件
             $ip = get_client_ip();
             $data["ip"] = $ip;
             $area = $ipLocation->getlocation($ip);
             // '203.34.5.66'); // 获取某个IP地址所在的位置
             $author_location = iconv('gbk', 'utf-8', $area['country'] . $area['area']);
             $data["location"] = $author_location;
         }
         session("access_trace_data", $data);
         // 设置用户已登录
         self::updateCounter($data);
     } else {
         // 检查是否已经是下一天
         $today = date("Y-m-d", time());
         $data = session("access_trace_data");
         if ($today > substr($data["thedate"], 0, 10)) {
             $data = session("access_trace_data");
             $data["thedate"] = date("Y-m-d H:i:s", time());
             self::updateCounter($data);
         }
     }
     $counter = session("access_trace_counter");
     $m = M("AccessTraceCounter");
     // 网站发布总天数
     $totalNo = $m->query("select count(distinct(date(thedate))) as c from think_access_trace_counter");
     $totalDay = intval($totalNo[0]["c"]) - 1;
     // 日均访问量
     $counter["avgNo"] = (int) (intval($counter["totalNo"]) / $totalDay);
     // 最高访问量
     $totalNo = $m->query("select count(*) as c from think_access_trace_counter group by date(thedate) order by c desc");
     $counter["maxNo"] = $totalNo[0]["c"];
     $data = session("access_trace_data");
     $data["thedate"] = date("Y-m-d H:i:s", time());
     $data["url"] = $url;
     // 记录访问详细信息
     $m = M("AccessTraceDetails");
     $m->add($data);
     $this->ajaxReturn($counter);
 }
Пример #19
0
 public function _initialize()
 {
     $result = M('dm_items')->query('select id,begin_time from dm_items where item_check = 3');
     foreach ($result as $key => $value) {
         if ($value['begin_time'] < time()) {
             M('dm_items')->query("update dm_items set item_check=1 where id = {$value['id']} ");
         }
     }
     // 查看项目是不是已经该上线了
     if (isMobile()) {
         $this->redirect('index/Mobile/mb');
     }
 }
Пример #20
0
 protected function _initialize()
 {
     //读取网站配置
     $this->siteinfo = M('siteinfo')->where('id=1')->find();
     //判断网站是否正常
     if ($this->siteinfo['sitestatus'] == '0') {
         //关闭状态
         $this->redirect('Public/errors');
     }
     //判断电脑还是手机
     if (!isMobile()) {
         $this->redirect('Index/index');
     }
 }
Пример #21
0
 public function __construct()
 {
     parent::__construct();
     $this->ini();
     $this->iniad();
     $plugin = "public/plugin.php";
     if (file_exists($plugin)) {
         include $plugin;
     }
     if (strtolower($this->mod) != 'wap' && isMobile()) {
         header("location:" . SITE_URL . 'index.php?m=wap');
         exit;
     }
 }
Пример #22
0
 function buildControl($value, $mode, $fieldNum = 0, $validate, $additionalCtrlParams, $data)
 {
     parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
     $nWidth = $this->pageObject->pSetEdit->getNCols($this->field);
     $nHeight = $this->pageObject->pSetEdit->getNRows($this->field);
     if ($this->pageObject->pSetEdit->isUseRTE($this->field)) {
         $value = RTESafe($value);
     } else {
         echo '<textarea id="' . $this->cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'name="' . $this->cfield . '" style="';
         if (!isMobile()) {
             echo "width: " . $nWidth . "px;";
         }
         echo 'height: ' . $nHeight . 'px;">' . htmlspecialchars($value) . '</textarea>';
     }
     $this->buildControlEnd($validate);
 }
Пример #23
0
    /**
     * Add mobile meta info. Add script to hide iPhone browser bar on pageload.
     */
    public function base_render_before($Sender)
    {
        if (isMobile() && is_object($Sender->Head)) {
            $Sender->Head->addTag('meta', array('name' => 'viewport', 'content' => "width=device-width,minimum-scale=1.0,maximum-scale=1.0"));
            $Sender->Head->addString('
<script>
   // If not looking for a specific comment, hide the address bar in iphone
   var hash = window.location.href.split("#")[1];
   if (typeof(hash) == "undefined") {
      setTimeout(function () {
        window.scrollTo(0, 1);
      }, 1000);
   }
</script>');
        }
    }
Пример #24
0
 /**
  * 新生产一条feed
  */
 public function add()
 {
     $data['userid'] = ACPopedom::getID();
     $data['action'] = C('FEED_ACTION_SEND');
     $data['feedtype'] = 1;
     $data['posttime'] = time();
     $data['appid'] = isMobile() ? C('FEED_APPID_PC') : C('FEED_APPID_MOBILE');
     $data['show'] = 1;
     $data['content'] = trim(I('post.content', ''));
     $data['picpath'] = empty($_POST['picpath']) ? '' : implode('#$', $_POST['picpath']);
     $data['video'] = '';
     if (!$data['content'] && !$data['picpath']) {
         $this->ajaxReturn(array('status' => false, 'message' => '太懒了,说点什么吧'));
     }
     $result = $this->_Model->add($data);
     $this->ajaxReturn($result ? array('status' => true, 'message' => '动态发表成功了,么么哒') : array('status' => false, 'message' => '由于服务器君罢工,发表动态失败啦..'));
 }
Пример #25
0
 protected function _initialize()
 {
     /* 读取站点配置 */
     $config = api('Config/lists');
     C($config);
     //添加配置
     if (!C('WEB_SITE_CLOSE')) {
         $this->error('站点已经关闭,请稍后访问~');
     }
     $this->pageTitle = "中瀛智募";
     if (isMobile()) {
         C('DEFAULT_THEME', 'mobile');
         if (empty($_SERVER['HTTP_REFERER'])) {
             $this->backurl = U('/');
         } else {
             //$this->backurl = $_SERVER['HTTP_REFERER'];
         }
         //echo $this->backurl;
     }
 }
Пример #26
0
 public function student()
 {
     $id = I('get.id');
     $page = I('get.page');
     $ajax = I('get.ajax') == 'true' ? true : false;
     $list = self::deliveryList($id, $page);
     $this->assign('delivery', $list['data']);
     $this->assign('page', $list['page']);
     $this->assign('text', $list['text']);
     $html = $this->fetch('Student:student_delivery_list');
     if (isMobile()) {
         redirect('/MobileStudent/delivery');
         exit;
     }
     if (!$ajax) {
         $this->assign('deliveryHtml', $html);
         $this->display('Student:student_delivery');
         exit;
     } else {
         returnjson(array('data' => $html));
     }
 }
$tdataFact_StockTransaction_Report[".popupPagesLayoutNames"] = $popupPagesLayoutNames;
$tdataFact_StockTransaction_Report[".fieldsForRegister"] = array();
$tdataFact_StockTransaction_Report[".listAjax"] = false;
$tdataFact_StockTransaction_Report[".audit"] = false;
$tdataFact_StockTransaction_Report[".locking"] = false;
$tdataFact_StockTransaction_Report[".list"] = true;
$tdataFact_StockTransaction_Report[".inlineAdd"] = true;
$tdataFact_StockTransaction_Report[".exportTo"] = true;
$tdataFact_StockTransaction_Report[".printFriendly"] = true;
$tdataFact_StockTransaction_Report[".showSimpleSearchOptions"] = false;
// search Saving settings
$tdataFact_StockTransaction_Report[".searchSaving"] = false;
//
$tdataFact_StockTransaction_Report[".showSearchPanel"] = true;
$tdataFact_StockTransaction_Report[".flexibleSearch"] = true;
if (isMobile()) {
    $tdataFact_StockTransaction_Report[".isUseAjaxSuggest"] = false;
} else {
    $tdataFact_StockTransaction_Report[".isUseAjaxSuggest"] = true;
}
$tdataFact_StockTransaction_Report[".addPageEvents"] = false;
// use timepicker for search panel
$tdataFact_StockTransaction_Report[".isUseTimeForSearch"] = false;
$tdataFact_StockTransaction_Report[".allSearchFields"] = array();
$tdataFact_StockTransaction_Report[".filterFields"] = array();
$tdataFact_StockTransaction_Report[".requiredSearchFields"] = array();
$tdataFact_StockTransaction_Report[".allSearchFields"][] = "fiscalYear";
$tdataFact_StockTransaction_Report[".allSearchFields"][] = "fiscalMonth";
$tdataFact_StockTransaction_Report[".allSearchFields"][] = "monthName";
$tdataFact_StockTransaction_Report[".allSearchFields"][] = "GroupID";
$tdataFact_StockTransaction_Report[".allSearchFields"][] = "CompanyID";
Пример #28
0
// create reusable searchControl builder instance
$searchControllerId = postvalue('searchControllerId') ? postvalue('searchControllerId') : $pageObject->id;
//	Before Process event
if ($eventObj->exists("BeforeProcessSearch")) {
    $eventObj->BeforeProcessSearch($conn, $pageObject);
}
// add constants and files for simple view
if ($mode == SEARCH_SIMPLE) {
    $searchControlBuilder = new AdvancedSearchControl($searchControllerId, $strTableName, $pageObject->searchClauseObj, $pageObject);
    // add button events if exist
    $pageObject->addButtonHandlers();
    $includes .= "<script language=\"JavaScript\" src=\"include/loadfirst.js\"></script>\r\n";
    //$includes.="<script language=\"JavaScript\" src=\"include/customlabels.js\"></script>\r\n";
    $includes .= "<script type=\"text/javascript\" src=\"include/lang/" . getLangFileName(mlang_getcurrentlang()) . ".js\"></script>";
    // if not simple, this div already exist on page
    if (!isMobile()) {
        $includes .= "<div id=\"search_suggest\" class=\"search_suggest\"></div>";
    }
    // search panel radio button assign
    $searchRadio = $searchControlBuilder->getSearchRadio();
    $xt->assign_section("all_checkbox_label", $searchRadio['all_checkbox_label'][0], $searchRadio['all_checkbox_label'][1]);
    $xt->assign_section("any_checkbox_label", $searchRadio['any_checkbox_label'][0], $searchRadio['any_checkbox_label'][1]);
    $xt->assignbyref("all_checkbox", $searchRadio['all_checkbox']);
    $xt->assignbyref("any_checkbox", $searchRadio['any_checkbox']);
    // search fields data
    if ($pageObject->pSet->getLookupTable("id")) {
        $pageObject->settingsMap["globalSettings"]['shortTNames'][$pageObject->pSet->getLookupTable("id")] = GetTableURL($pageObject->pSet->getLookupTable("id"));
    }
    $pageObject->fillFieldToolTips("id");
    $srchFields = $pageObject->searchClauseObj->getSearchCtrlParams("id");
    $firstFieldParams = array();
Пример #29
0
    $pageObject->fillControlsMap($controls);
    //fill field tool tips
    $pageObject->fillFieldToolTips($fName);
    // fill special settings for timepicker
    if ($pageObject->pSet->getEditFormat($fName) == 'Time') {
        $pageObject->fillTimePickSettings($fName, @$defvalues[$fName]);
    }
    if (($detailKeys && in_array($fName, $detailKeys) || $fName == postvalue("category")) && array_key_exists($fName, $defvalues)) {
        $value = $pageObject->showDBValue($fName, $defvalues);
        $xt->assign($gfName . "_editcontrol", $value);
    }
}
//fill tab groups name and sections name to controls
$pageObject->fillCntrlTabGroups();
/////////////////////////////////////////////////////////////
if ($pageObject->isShowDetailTables && ($inlineadd == ADD_SIMPLE || $inlineadd == ADD_POPUP) && !isMobile()) {
    if (count($dpParams['ids'])) {
        $xt->assign("detail_tables", true);
        include 'classes/listpage.php';
        include 'classes/listpage_embed.php';
        include 'classes/listpage_dpinline.php';
        include "classes/searchclause.php";
    }
    $dControlsMap = array();
    $dViewControlsMap = array();
    $flyId = $ids + 1;
    for ($d = 0; $d < count($dpParams['ids']); $d++) {
        $options = array();
        //array of params for classes
        $options["mode"] = LIST_DETAILS;
        $options["pageType"] = PAGE_LIST;
Пример #30
0
        $xt->assign($gfName . "_editcontrol", $value);
    }
}
//fill tab groups name and sections name to controls
$pageObject->fillCntrlTabGroups();
$pageObject->jsSettings['tableSettings'][$strTableName]["keys"] = $pageObject->jsKeys;
$pageObject->jsSettings['tableSettings'][$strTableName]['keyFields'] = $pageObject->keyFields;
$pageObject->jsSettings['tableSettings'][$strTableName]["prevKeys"] = $prev;
$pageObject->jsSettings['tableSettings'][$strTableName]["nextKeys"] = $next;
if ($pageObject->lockingObj) {
    $pageObject->jsSettings['tableSettings'][$strTableName]["sKeys"] = $skeys;
    $pageObject->jsSettings['tableSettings'][$strTableName]["enableCtrls"] = $enableCtrlsForEditing;
    $pageObject->jsSettings['tableSettings'][$strTableName]["confirmTime"] = $pageObject->lockingObj->ConfirmTime;
}
/////////////////////////////////////////////////////////////
if ($pageObject->isShowDetailTables && $inlineedit != EDIT_INLINE && !isMobile()) {
    if (count($dpParams['ids'])) {
        include 'classes/listpage.php';
        include 'classes/listpage_embed.php';
        include 'classes/listpage_dpinline.php';
        $xt->assign("detail_tables", true);
    }
    $dControlsMap = array();
    $dViewControlsMap = array();
    $flyId = $ids + 1;
    for ($d = 0; $d < count($dpParams['ids']); $d++) {
        $options = array();
        //array of params for classes
        $options["mode"] = LIST_DETAILS;
        $options["pageType"] = PAGE_LIST;
        $options["masterPageType"] = PAGE_EDIT;