コード例 #1
0
ファイル: ResponsiveHtml.php プロジェクト: dsyman2/X2CRM
 public static function gripButton($htmlOptions = array())
 {
     if (AuxLib::getLayoutType() !== 'responsive') {
         return '';
     }
     if (!isset($htmlOptions['class'])) {
         $htmlOptions['class'] = 'mobile-dropdown-button';
     }
     return self::tag('div', $htmlOptions, '<div class="x2-bar"></div>
          <div class="x2-bar"></div>
          <div class="x2-bar"></div>');
 }
コード例 #2
0
ファイル: X2GridViewBase.php プロジェクト: dsyman2/X2CRM
 public function renderSummary()
 {
     if (AuxLib::getLayoutType() === 'responsive' && $this->enableResponsiveTitleBar) {
         Yii::app()->clientScript->registerCss('mobileDropdownCss', "\n            .grid-view .mobile-dropdown-button {\n                float: right;\n                display: block;\n                margin-top: -24px;\n                margin-right: 8px;\n            }\n        ");
         $afterUpdateJSString = "\n            ;(function () {\n            var grid = \$('#" . $this->id . "');\n            \$('#" . $this->namespacePrefix . "-mobile-dropdown').unbind ('click.mobileDropdownScript')\n                .bind ('click.mobileDropdownScript', function () {\n                    if (grid.hasClass ('show-top-buttons')) {\n                        grid.find ('.page-title').css ({ height: '' });\n                        grid.removeClass ('show-top-buttons');\n                    } else {\n                        grid.find ('.page-title').animate ({ height: '68px' }, 300);\n                        grid.addClass ('show-top-buttons');\n                        \$(window).one ('resize', function () {\n                            grid.find ('.page-title').css ({ height: '' });\n                            grid.removeClass ('show-top-buttons');\n                        });\n                    }\n                });\n            }) ();\n        ";
         $this->addToAfterAjaxUpdate($afterUpdateJSString);
         echo '<div id="' . $this->namespacePrefix . '-mobile-dropdown" class="mobile-dropdown-button">
             <div class="x2-bar"></div>
             <div class="x2-bar"></div>
             <div class="x2-bar"></div>
         </div>';
     }
     parent::renderSummary();
 }
コード例 #3
0
ファイル: main.php プロジェクト: tymiles003/X2CRM
" type="image/x-icon">
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?php 
echo $themeUrl;
?>
/css/ie.css" media="screen, projection">
<![endif]-->
<title><?php 
echo CHtml::encode($this->pageTitle);
?>
</title>
<?php 
if (method_exists($this, 'renderGaCode')) {
    $this->renderGaCode('internal');
}
if (AuxLib::getLayoutType() === 'responsive') {
    ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<?php 
}
?>
</head>
<?php 
echo X2Html::openBodyTag($preferences);
//if (YII_DEBUG && YII_UNIT_TESTING) {
//    echo "<div id='qunit'></div>";
//}
?>

<div id="page-container">
<div id="page">
コード例 #4
0
ファイル: X2ClientScript.php プロジェクト: tymiles003/X2CRM
 /**
  * Performs all the necessary JavaScript/CSS initializations for most parts of the app.
  */
 public function registerMain()
 {
     $fullscreen = $this->fullscreen;
     $profile = $this->profile;
     $baseUrl = $this->baseUrl;
     $themeUrl = $this->themeUrl;
     $scriptUrl = $this->scriptUrl;
     $admin = $this->admin;
     $isGuest = $this->isGuest;
     // jQuery and jQuery UI libraries
     $this->registerCoreScript('jquery')->registerCoreScript('jquery.ui')->registerCoreScript('jquery.migrate')->registerCoreScript('bbq');
     $this->registerPackages($this->getDefaultPackages());
     $cldScript = $this->getCurrencyConfigScript();
     AuxLib::registerPassVarsToClientScriptScript('auxlib', array('saveMiscLayoutSettingUrl' => "'" . addslashes(Yii::app()->createUrl('/profile/saveMiscLayoutSetting')) . "'"), 'passAuxLibVars');
     $this->registerX2ModelMappingsScript();
     $this->registerX2Forms();
     $this->registerX2QuickCRUD();
     $this->registerX2Flashes();
     Yii::app()->clientScript->registerScript('csrfTokenScript', "\n            x2.csrfToken = '" . Yii::app()->request->getCsrfToken() . "';\n        ", CClientScript::POS_HEAD);
     $this->registerAttachments();
     $this->registerDateFormats();
     if (YII_DEBUG) {
         $this->registerScriptFile($baseUrl . '/js/Timer.js');
     }
     Yii::app()->clientScript->registerPackage('spectrum');
     // custom scripts
     $this->registerScriptFile($baseUrl . '/js/json2.js')->registerScriptFile($baseUrl . '/js/lib/lodash/lodash.js', self::POS_END)->registerScriptFile($baseUrl . '/js/webtoolkit.sha256.js')->registerScriptFile($baseUrl . '/js/main.js', CCLientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/auxlib.js', CClientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/IframeFixOverlay.js', CClientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/LayoutManager.js')->registerScriptFile($baseUrl . '/js/media.js')->registerScript('formatCurrency-locales', $cldScript, CCLientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/modernizr.custom.66175.js')->registerScriptFile($baseUrl . '/js/widgets.js')->registerScriptFile($baseUrl . '/js/qtip/jquery.qtip.js')->registerScriptFile($baseUrl . '/js/ActionFrames.js')->registerScriptFile($baseUrl . '/js/ColorPicker.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/PopupDropdownMenu.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/jQueryOverrides.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/checklistDropdown/jquery.multiselect.js');
     $this->registerTestingScripts();
     $this->registerDebuggingScripts();
     if (AuxLib::isIPad()) {
         $this->registerScriptFile($baseUrl . '/js/jquery.mobile.custom.js');
     }
     $this->registerInitScript();
     $this->registerAuxLibTranslationsScript();
     if (Yii::app()->session['translate']) {
         $this->registerScriptFile($baseUrl . '/js/translator.js');
     }
     $this->registerScriptFile($baseUrl . '/js/backgroundFade.js');
     $this->registerScript('datepickerLanguage', "\n            \$.datepicker.setDefaults(\$.datepicker.regional['']);\n        ");
     $mmPath = Yii::getPathOfAlias('application.extensions.moneymask.assets');
     $aMmPath = Yii::app()->getAssetManager()->publish($mmPath);
     $this->registerScriptFile("{$aMmPath}/jquery.maskMoney.js");
     $this->registerCssFile($baseUrl . '/css/normalize.css', 'all')->registerCssFile($themeUrl . '/css/print.css', 'print')->registerCoreScript('cookie');
     $this->registerCombinedCss();
     if (AuxLib::getLayoutType() !== 'responsive' && AuxLib::isAndroid()) {
         $this->registerCssFile($themeUrl . '/css/androidLayout.css', 'screen, projection');
     } elseif (AuxLib::isIPad()) {
         $this->registerCssFile($themeUrl . '/css/ipadLayout.css', 'screen, projection');
     }
     $this->registerScript('fullscreenToggle', '
         window.enableFullWidth = ' . (!Yii::app()->user->isGuest ? $profile->enableFullWidth ? 'true' : 'false' : 'true') . ';
         window.fullscreen = ' . ($fullscreen ? 'true' : 'false') . ';
     ', CClientScript::POS_HEAD);
     if (is_object(Yii::app()->controller->module)) {
         $this->registerScript('saveCurrModule', "\n                x2.currModule = '" . Yii::app()->controller->module->name . "';\n            ", CClientScript::POS_HEAD);
     }
     if (!$isGuest) {
         $this->registerScript('notificationsParams', "\n                x2.notifications = new x2.Notifs ({\n                    disablePopup: " . ($profile->disableNotifPopup ? 'true' : 'false') . ",\n                    translations: {\n                        clearAll: '" . addslashes(Yii::t('app', 'Permanently delete all notifications?')) . "'\n                    }\n                });\n            ", CClientScript::POS_READY);
         $this->registerScriptFile($baseUrl . '/js/jstorage.min.js')->registerScriptFile($baseUrl . '/js/notifications.js', CClientScript::POS_BEGIN);
     }
     if (!$isGuest && ($profile->language == 'he' || $profile->language == 'fa')) {
         $this->registerCss('rtl-language', 'body{text-align:right;}');
     }
     $this->registerCoreScript('rating');
 }
コード例 #5
0
ファイル: X2Html.php プロジェクト: tymiles003/X2CRM
 public static function openBodyTag($preferences, array $htmlOptions = array())
 {
     $cs = Yii::app()->clientScript;
     $baseUrl = $cs->baseUrl;
     $fullscreen = $cs->fullscreen;
     $style = '';
     $classes = 'enable-search-bar-modes';
     $noBorders = false;
     if ($preferences != null && $preferences['backgroundColor']) {
         $style .= 'background-color:#' . $preferences['backgroundColor'] . ';';
     }
     if ($preferences != null && $preferences['backgroundImg']) {
         if (Yii::app()->user->isGuest) {
             $media = Media::model()->findByAttributes(array('id' => $preferences['backgroundImg']));
             if ($media) {
                 $mediaUrl = $media->getPublicUrl();
             }
         } else {
             $mediaUrl = $baseUrl . Yii::app()->request->scriptUrl . '/media/getFile/' . $preferences['backgroundImg'];
         }
         if (isset($mediaUrl)) {
             $style .= 'background-image:url(' . $mediaUrl . ');';
             $classes .= ' custom-background-image';
         }
         switch ($bgTiling = $preferences['backgroundTiling']) {
             case 'repeat-x':
             case 'repeat-y':
             case 'repeat':
                 $style .= 'background-repeat:' . $bgTiling . ';';
                 break;
             case 'center':
                 $style .= 'background-repeat:no-repeat;background-position:center center;';
                 break;
             case 'stretch':
             default:
                 $style .= 'background-attachment:fixed;background-size:cover;';
                 $noBorders = true;
         }
     }
     if ($noBorders) {
         $classes .= ' no-borders';
     }
     if ($fullscreen) {
         $classes .= ' no-widgets';
     } else {
         $classes .= ' show-widgets';
     }
     if (AuxLib::getLayoutType() !== 'responsive') {
         $classes .= ' disable-mobile-layout';
     }
     $classes .= ' not-mobile-body';
     $htmlOptions = self::mergeHtmlOptions(array('class' => $classes, 'style' => $style), $htmlOptions);
     return self::openTag('body', $htmlOptions);
 }