当前位置: 首页>>代码示例>>PHP>>正文


PHP Journal2Utils::getColor方法代码示例

本文整理汇总了PHP中Journal2Utils::getColor方法的典型用法代码示例。如果您正苦于以下问题:PHP Journal2Utils::getColor方法的具体用法?PHP Journal2Utils::getColor怎么用?PHP Journal2Utils::getColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Journal2Utils的用法示例。


在下文中一共展示了Journal2Utils::getColor方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     if (Journal2Cache::$mobile_detect->isMobile()) {
         return;
     }
     Journal2::startTimer(get_class($this));
     $this->journal2->html_classes->addClass('side-blocks-active');
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $cache_property = "module_journal_side_blocks_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}";
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'module_data.position')) {
             $css[] = 'position: ' . Journal2Utils::getProperty($module_data, 'module_data.position');
         }
         if (Journal2Utils::getProperty($module_data, 'module_data.offset_top')) {
             $css[] = 'top: ' . Journal2Utils::getProperty($module_data, 'module_data.offset_top', 0) . 'px';
         }
         $this->data['icon'] = Journal2Utils::getIconOptions2(Journal2Utils::getProperty($module_data, 'module_data.icon'));
         $this->data['icon_bgcolor'] = 'transparent';
         if (Journal2Utils::getProperty($module_data, 'module_data.icon_bg_color')) {
             $this->data['icon_bgcolor'] = Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'module_data.icon_bg_color'));
         }
         $this->data['icon_border'] = implode('; ', Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($module_data, 'module_data.icon_border')));
         $this->data['content_bgcolor'] = 'transparent';
         $position = Journal2Utils::getProperty($module_data, 'module_data.alignment', 'left');
         switch (Journal2Utils::getProperty($module_data, 'module_data.module_type', 'block')) {
             case 'button':
                 $this->data['type'] = 'button';
                 $this->data['url'] = $this->model_journal2_menu->getLink(Journal2Utils::getProperty($module_data, 'module_data.link'));
                 $this->data['target'] = Journal2Utils::getProperty($module_data, 'module_data.new_window') ? 'target="_blank"' : '';
                 if (Journal2Utils::getProperty($module_data, 'module_data.icon_bg_hover_color')) {
                     $this->data['icon_bg_hover_color'] = Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'module_data.icon_bg_hover_color'));
                 } else {
                     $this->data['icon_bg_hover_color'] = false;
                 }
                 $offset = Journal2Utils::getProperty($module_data, 'module_data.offset_side', 0) . 'px';
                 $css[] = "{$position}: {$offset}";
                 break;
             case 'block':
                 $this->data['type'] = 'block';
                 $this->data['url'] = 'index.php?route=module/journal2_side_blocks/load&module_id=' . $setting['module_id'];
                 $this->data['content_padding'] = Journal2Utils::getProperty($module_data, 'module_data.content_padding', 0) . 'px';
                 if (Journal2Utils::getProperty($module_data, 'module_data.content_width', 300)) {
                     $css[] = 'width: ' . Journal2Utils::getProperty($module_data, 'module_data.content_width', 300) . 'px';
                     $css[] = (Journal2Utils::getProperty($module_data, 'module_data.alignment') === 'left' ? 'left' : 'right') . ': -' . Journal2Utils::getProperty($module_data, 'module_data.content_width', 300) . 'px';
                 }
                 if (Journal2Utils::getProperty($module_data, 'module_data.content_bg_color')) {
                     $this->data['content_bgcolor'] = Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'module_data.content_bg_color'));
                 }
                 break;
         }
         $this->data['icon_width'] = Journal2Utils::getProperty($module_data, 'module_data.icon_width', 50) . 'px';
         $this->data['icon_height'] = Journal2Utils::getProperty($module_data, 'module_data.icon_height', 50) . 'px';
         if ($position === 'left') {
             $this->data['pos_offset'] = 'right: -' . $this->data['icon_width'];
         } else {
             $this->data['pos_offset'] = 'left: -' . $this->data['icon_width'];
         }
         $this->data['module'] = $module;
         $this->data['alignment'] = Journal2Utils::getProperty($module_data, 'module_data.alignment');
         $this->data['css'] = implode('; ', $css);
         $this->template = $this->config->get('config_template') . '/template/journal2/module/side_blocks.tpl';
         if (self::$CACHEABLE === true) {
             $html = Minify_HTML::minify($this->render(), array('xhtml' => false, 'jsMinifier' => 'j2_js_minify'));
             $this->journal2->cache->set($cache_property, $html);
         }
     } else {
         $this->template = $this->config->get('config_template') . '/template/journal2/cache/cache.tpl';
         $this->data['cache'] = $cache;
     }
     $output = $this->render();
     Journal2::stopTimer(get_class($this));
     return $output;
 }
开发者ID:SwayWebStudio,项目名称:night.com,代码行数:83,代码来源:journal2_side_blocks.php

示例2: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* hide on mobile */
     if (Journal2Utils::getProperty($module_data, 'disable_mobile') && (Journal2Cache::$mobile_detect->isMobile() && !Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
         return;
     }
     /* hide on desktop */
     if (Journal2Utils::getProperty($module_data, 'disable_desktop') && !Journal2Cache::$mobile_detect->isMobile()) {
         return;
     }
     $this->data['css'] = '';
     /* css for top / bottom positions */
     if (in_array($setting['position'], array('top', 'bottom'))) {
         $padding = $this->journal2->settings->get('module_margins', 20) . 'px';
         /* outer */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'background'));
         $css[] = 'padding-top: ' . Journal2Utils::getProperty($module_data, 'margin_top', 0) . 'px';
         $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($module_data, 'margin_bottom', 0) . 'px';
         $this->journal2->settings->set('module_journal2_carousel_' . $setting['module_id'], implode('; ', $css));
         /* inner css */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'fullwidth')) {
             $css[] = 'max-width: 100%';
             $css[] = 'padding-left: ' . $padding;
             $css[] = 'padding-right: ' . $padding;
         } else {
             $css[] = 'max-width: ' . $this->journal2->settings->get('site_width', 1024) . 'px';
             $css = array_merge($css, Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'module_background')));
             if (Journal2Utils::getProperty($module_data, 'module_padding')) {
                 $this->data['gutter_on_class'] = 'gutter-on';
                 $css[] = 'padding: 20px';
             }
         }
         $this->data['css'] = implode('; ', $css);
     }
     $cache_property = "module_journal_carousel_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}" . $this->journal2->cache->getRouteCacheKey();
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         $this->data['hide_on_mobile_class'] = Journal2Utils::getProperty($module_data, 'disable_mobile') ? 'hide-on-mobile' : '';
         /* set global module properties */
         $this->data['module'] = $module;
         $this->data['show_title'] = Journal2Utils::getProperty($module_data, 'show_title');
         $this->data['brand_name'] = Journal2Utils::getProperty($module_data, 'brand_name');
         $this->data['module_type'] = Journal2Utils::getProperty($module_data, 'module_type');
         $this->data['arrows'] = Journal2Utils::getProperty($module_data, 'arrows', 'top');
         $this->data['bullets'] = Journal2Utils::getProperty($module_data, 'bullets');
         $this->data['render_as'] = Journal2Utils::getProperty($module_data, 'display_as');
         if (Journal2Utils::getProperty($module_data, 'autoplay')) {
             $this->data['autoplay'] = (int) Journal2Utils::getProperty($module_data, 'transition_delay', 3000);
         } else {
             $this->data['autoplay'] = false;
         }
         $this->data['slide_speed'] = (int) Journal2Utils::getProperty($module_data, 'transition_speed', 400);
         $this->data['pause_on_hover'] = Journal2Utils::getProperty($module_data, 'pause_on_hover');
         $this->data['touch_drag'] = Journal2Utils::getProperty($module_data, 'touch_drag');
         $this->data['default_section'] = '';
         /* generate sections */
         $this->data['sections'] = array();
         $this->data['items'] = array();
         /* image dimensions */
         $this->data['image_width'] = Journal2Utils::getProperty($module_data, 'image_width', $this->config->get('config_image_product_width'));
         $this->data['image_height'] = Journal2Utils::getProperty($module_data, 'image_height', $height = $this->config->get('config_image_product_height'));
         $this->data['image_resize_type'] = Journal2Utils::getProperty($module_data, 'image_type', 'fit');
         $this->data['dummy_image'] = $this->model_tool_image->resize('data/journal2/transparent.png', $this->data['image_width'], $this->data['image_height']);
         /* image border */
         if (Journal2Utils::getProperty($module_data, 'image_border')) {
             $this->data['image_border_css'] = implode('; ', Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($module_data, 'image_border')));
         } else {
             $this->data['image_border_css'] = null;
         }
         /* image background color */
         if (Journal2Utils::getProperty($module_data, 'image_bgcolor.value.color')) {
             $this->data['image_bgcolor'] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'image_bgcolor.value.color'));
         } else {
             $this->data['image_bgcolor'] = null;
         }
         switch ($this->data['module_type']) {
             case 'product':
                 $sections = Journal2Utils::getProperty($module_data, 'product_sections', array());
                 $sections = Journal2Utils::sortArray($sections);
                 $this->generateProductSections($sections);
                 $this->data['text_tax'] = $this->language->get('text_tax');
                 $this->data['button_cart'] = $this->language->get('button_cart');
                 $this->data['button_wishlist'] = $this->language->get('button_wishlist');
                 $this->data['button_compare'] = $this->language->get('button_compare');
                 break;
             case 'category':
                 $sections = Journal2Utils::getProperty($module_data, 'category_sections', array());
                 $sections = Journal2Utils::sortArray($sections);
//.........这里部分代码省略.........
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:101,代码来源:journal2_carousel.php

示例3: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* hide on mobile */
     if (Journal2Utils::getProperty($module_data, 'disable_mobile') && (Journal2Cache::$mobile_detect->isMobile() && !Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
         return;
     }
     /* hide on desktop */
     if (Journal2Utils::getProperty($module_data, 'disable_desktop') && !Journal2Cache::$mobile_detect->isMobile()) {
         return;
     }
     $this->data['css'] = '';
     /* css for top / bottom positions */
     if (in_array($setting['position'], array('top', 'bottom'))) {
         $padding = $this->journal2->settings->get('module_margins', 20) . 'px';
         /* outer */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'background'));
         $css[] = 'padding-top: ' . Journal2Utils::getProperty($module_data, 'margin_top', 0) . 'px';
         $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($module_data, 'margin_bottom', 0) . 'px';
         $this->journal2->settings->set('module_journal2_headline_rotator_' . $setting['module_id'], implode('; ', $css));
         /* inner css */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'fullwidth')) {
             $css[] = 'max-width: 100%';
             $css[] = 'padding-left: ' . $padding;
             $css[] = 'padding-right: ' . $padding;
         } else {
             $css[] = 'max-width: ' . $this->journal2->settings->get('site_width', 1024) . 'px';
         }
         $this->data['css'] = implode('; ', $css);
     }
     $cache_property = "module_journal_headline_rotator_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}";
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         $this->data['hide_on_mobile_class'] = Journal2Utils::getProperty($module_data, 'disable_mobile') ? 'hide-on-mobile' : '';
         /* set global module properties */
         $this->data['module'] = $module;
         $this->data['transition_delay'] = Journal2Utils::getProperty($module_data, 'transition_delay', 4000);
         $this->data['bullets_position'] = Journal2Utils::getProperty($module_data, 'bullets_position', 'center');
         /* quote options */
         $css = array();
         $css[] = 'text-align: ' . Journal2Utils::getProperty($module_data, 'text_align', 'center');
         $this->data['text_align'] = Journal2Utils::getProperty($module_data, 'text_align', 'center');
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') === 'google') {
             $font_name = Journal2Utils::getProperty($module_data, 'text_font.value.font_name');
             $font_subset = Journal2Utils::getProperty($module_data, 'text_font.value.font_subset');
             $font_weight = Journal2Utils::getProperty($module_data, 'text_font.value.font_weight');
             $this->journal2->google_fonts->add($font_name, $font_subset, $font_weight);
             $this->google_fonts[] = array('name' => $font_name, 'subset' => $font_subset, 'weight' => $font_weight);
             $weight = filter_var(Journal2Utils::getProperty($module_data, 'text_font.value.font_weight'), FILTER_SANITIZE_NUMBER_INT);
             $css[] = 'font-weight: ' . ($weight ? $weight : 400);
             $css[] = "font-family: '" . Journal2Utils::getProperty($module_data, 'text_font.value.font_name') . "'";
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') === 'system') {
             $css[] = 'font-weight: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_weight');
             $css[] = 'font-family: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_family');
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') !== 'none') {
             $css[] = 'font-size: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_size');
             $css[] = 'font-style: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_style');
             $css[] = 'text-transform: ' . Journal2Utils::getProperty($module_data, 'text_font.value.text_transform');
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.color.value.color')) {
             $css[] = 'color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'text_font.value.color.value.color'));
         }
         $this->data['quote_css'] = implode('; ', $css);
         /* rotator options */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'text_background'));
         $this->data['rotator_css'] = implode('; ', $css);
         /* sections */
         $this->data['sections'] = array();
         $sections = Journal2Utils::getProperty($module_data, 'sections', array());
         $sections = Journal2Utils::sortArray($sections);
         foreach ($sections as $section) {
             if (!$section['status']) {
                 continue;
             }
             $offset_style = array();
             if (Journal2Utils::getProperty($section, 'cta_offset_top')) {
                 $offset_style[] = 'top: ' . Journal2Utils::getProperty($section, 'cta_offset_top') . 'px';
             }
             if (Journal2Utils::getProperty($section, 'cta_offset_left')) {
                 $offset_style[] = 'left: ' . Journal2Utils::getProperty($section, 'cta_offset_left') . 'px';
             }
             $this->data['sections'][] = array('text' => Journal2Utils::getProperty($section, 'text.value.' . $this->config->get('config_language_id')), 'icon' => Journal2Utils::getIconOptions2(Journal2Utils::getProperty($section, 'icon')), 'cta_icon_position' => Journal2Utils::getProperty($section, 'cta_icon_position', 'right'), 'cta' => Journal2Utils::getProperty($section, 'cta'), 'cta_position' => Journal2Utils::getProperty($section, 'cta_position'), 'cta_text' => Journal2Utils::getProperty($section, 'cta_text.value.' . $this->config->get('config_language_id')), 'cta_icon' => Journal2Utils::getIconOptions2(Journal2Utils::getProperty($section, 'cta_icon')), 'cta_link' => $this->model_journal2_menu->getLink(Journal2Utils::getProperty($section, 'cta_link')), 'cta_target' => Journal2Utils::getProperty($section, 'cta_new_window') ? 'target="_blank"' : '', 'cta_style' => implode('; ', $offset_style));
         }
         /* bullets */
         $this->data['bullets'] = Journal2Utils::getProperty($module_data, 'bullets') && count($this->data['sections']) > 1 ? true : false;
         /* pause on hover */
         $this->data['pause_on_hover'] = Journal2Utils::getProperty($module_data, 'pause_on_hover', '1');
//.........这里部分代码省略.........
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:101,代码来源:journal2_headline_rotator.php

示例4: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* device detection */
     $this->data['disable_on_classes'] = array();
     if ($this->journal2->settings->get('responsive_design')) {
         $device = Journal2Utils::getDevice();
         if (Journal2Utils::getProperty($module_data, 'enable_on_phone', '1') == '0') {
             if ($device === 'phone') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-phone';
             }
         }
         if (Journal2Utils::getProperty($module_data, 'enable_on_tablet', '1') == '0') {
             if ($device === 'tablet') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-tablet';
             }
         }
         if (Journal2Utils::getProperty($module_data, 'enable_on_desktop', '1') == '0') {
             if ($device === 'desktop') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-desktop';
             }
         }
     }
     $this->data['css'] = '';
     /* css for top / bottom positions */
     if (in_array($setting['position'], array('top', 'bottom'))) {
         $padding = $this->journal2->settings->get('module_margins', 20) . 'px';
         /* outer */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'background'));
         $css[] = 'padding-top: ' . Journal2Utils::getProperty($module_data, 'margin_top', 0) . 'px';
         $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($module_data, 'margin_bottom', 0) . 'px';
         $this->journal2->settings->set('module_journal2_text_rotator_' . $setting['module_id'], implode('; ', $css));
         $this->journal2->settings->set('module_journal2_text_rotator_' . $setting['module_id'] . '_classes', implode(' ', $this->data['disable_on_classes']));
         /* inner css */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'fullwidth')) {
             $css[] = 'max-width: 100%';
             $css[] = 'padding-left: ' . $padding;
             $css[] = 'padding-right: ' . $padding;
         } else {
             $css[] = 'max-width: ' . $this->journal2->settings->get('site_width', 1024) . 'px';
         }
         $this->data['css'] = implode('; ', $css);
     }
     $cache_property = "module_journal_text_rotator_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}";
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         /* set global module properties */
         $this->data['module'] = $module;
         $this->data['transition_delay'] = Journal2Utils::getProperty($module_data, 'transition_delay', 4000);
         $this->data['bullets_position'] = Journal2Utils::getProperty($module_data, 'bullets_position', 'center');
         $this->data['title'] = Journal2Utils::getProperty($module_data, 'module_title.value.' . $this->config->get('config_language_id'), '');
         /* quote options */
         $css = array();
         $css[] = 'text-align: ' . Journal2Utils::getProperty($module_data, 'text_align', 'center');
         $this->data['text_align'] = Journal2Utils::getProperty($module_data, 'text_align', 'center');
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') === 'google') {
             $font_name = Journal2Utils::getProperty($module_data, 'text_font.value.font_name');
             $font_subset = Journal2Utils::getProperty($module_data, 'text_font.value.font_subset');
             $font_weight = Journal2Utils::getProperty($module_data, 'text_font.value.font_weight');
             $this->journal2->google_fonts->add($font_name, $font_subset, $font_weight);
             $this->google_fonts[] = array('name' => $font_name, 'subset' => $font_subset, 'weight' => $font_weight);
             $weight = filter_var(Journal2Utils::getProperty($module_data, 'text_font.value.font_weight'), FILTER_SANITIZE_NUMBER_INT);
             $css[] = 'font-weight: ' . ($weight ? $weight : 400);
             $css[] = "font-family: '" . Journal2Utils::getProperty($module_data, 'text_font.value.font_name') . "'";
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') === 'system') {
             $css[] = 'font-weight: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_weight');
             $css[] = 'font-family: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_family');
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') !== 'none') {
             $css[] = 'font-size: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_size');
             $css[] = 'font-style: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_style');
             $css[] = 'text-transform: ' . Journal2Utils::getProperty($module_data, 'text_font.value.text_transform');
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.color.value.color')) {
             $css[] = 'color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'text_font.value.color.value.color'));
         }
         $this->data['quote_css'] = implode('; ', $css);
         /* author options */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'author_font.value.font_type') === 'google') {
             $font_name = Journal2Utils::getProperty($module_data, 'author_font.value.font_name');
             $font_subset = Journal2Utils::getProperty($module_data, 'author_font.value.font_subset');
//.........这里部分代码省略.........
开发者ID:SwayWebStudio,项目名称:night.com,代码行数:101,代码来源:journal2_text_rotator.php

示例5: index


//.........这里部分代码省略.........
                     case 'image':
                         $image = Journal2Utils::getProperty($caption, 'image', 'no_image.jpg');
                         if (is_array($image)) {
                             $image = Journal2Utils::getProperty($image, $this->config->get('config_language_id'));
                         }
                         if (!$image || !file_exists(DIR_IMAGE . $image)) {
                             $image = 'no_image.jpg';
                         }
                         $image = Journal2Utils::resizeImage($this->model_tool_image, $image);
                         $alt = Journal2Utils::getProperty($caption, 'caption_name');
                         $content = '<img src="' . $image . '" alt="' . $alt . '" />';
                         break;
                     case 'text':
                         if (Journal2Utils::getProperty($caption, 'text_font.value.font_type') === 'google') {
                             $font_name = Journal2Utils::getProperty($caption, 'text_font.value.font_name');
                             $font_subset = Journal2Utils::getProperty($caption, 'text_font.value.font_subset');
                             $font_weight = Journal2Utils::getProperty($caption, 'text_font.value.font_weight');
                             $this->journal2->google_fonts->add($font_name, $font_subset, $font_weight);
                             $this->google_fonts[] = array('name' => $font_name, 'subset' => $font_subset, 'weight' => $font_weight);
                             $weight = filter_var(Journal2Utils::getProperty($caption, 'text_font.value.font_weight'), FILTER_SANITIZE_NUMBER_INT);
                             $css[] = 'font-weight: ' . ($weight ? $weight : 400);
                             $css[] = "font-family: '" . Journal2Utils::getProperty($caption, 'text_font.value.font_name') . "'";
                         }
                         if (Journal2Utils::getProperty($caption, 'text_font.value.font_type') === 'system') {
                             $css[] = 'font-weight: ' . Journal2Utils::getProperty($caption, 'text_font.value.font_weight');
                             $css[] = 'font-family: ' . Journal2Utils::getProperty($caption, 'text_font.value.font_family');
                         }
                         if (Journal2Utils::getProperty($caption, 'text_font.value.font_type') !== 'none') {
                             $css[] = 'font-size: ' . Journal2Utils::getProperty($caption, 'text_font.value.font_size');
                             $css[] = 'font-style: ' . Journal2Utils::getProperty($caption, 'text_font.value.font_style');
                             $css[] = 'text-transform: ' . Journal2Utils::getProperty($caption, 'text_font.value.text_transform');
                         }
                         if (Journal2Utils::getProperty($caption, 'text_font.value.color.value.color')) {
                             $css[] = 'color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($caption, 'text_font.value.color.value.color'));
                         }
                         $css[] = 'text-align: ' . Journal2Utils::getProperty($caption, 'text_align', 'center');
                         if (Journal2Utils::getProperty($caption, 'text_bgcolor.value.color')) {
                             $css[] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($caption, 'text_bgcolor.value.color'));
                         }
                         if (Journal2Utils::getProperty($caption, 'text_hover_color.value.color')) {
                             $this->data['global_style'][] = "#jcaption-{$module}-{$caption_id}:hover { color: " . Journal2Utils::getColor(Journal2Utils::getProperty($caption, 'text_hover_color.value.color')) . " !important; }";
                         }
                         if (Journal2Utils::getProperty($caption, 'text_hover_bg_color.value.color')) {
                             $this->data['global_style'][] = "#jcaption-{$module}-{$caption_id}:hover { background-color: " . Journal2Utils::getColor(Journal2Utils::getProperty($caption, 'text_hover_bg_color.value.color')) . " !important; }";
                         }
                         if (Journal2Utils::getProperty($caption, 'text_border')) {
                             $css = array_merge($css, Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($caption, 'text_border')));
                         }
                         if (Journal2Utils::getProperty($caption, 'text_hover_border_color.value.color')) {
                             $this->data['global_style'][] = "#jcaption-{$module}-{$caption_id}:hover { border-color: " . Journal2Utils::getColor(Journal2Utils::getProperty($caption, 'text_hover_border_color.value.color')) . " !important; }";
                         }
                         if (Journal2Utils::getProperty($caption, 'text_padding_top') !== null) {
                             $css[] = 'padding-top: ' . Journal2Utils::getProperty($caption, 'text_padding_top') . 'px';
                         }
                         if (Journal2Utils::getProperty($caption, 'text_padding_right') !== null) {
                             $css[] = 'padding-right: ' . Journal2Utils::getProperty($caption, 'text_padding_right') . 'px';
                         }
                         if (Journal2Utils::getProperty($caption, 'text_padding_bottom') !== null) {
                             $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($caption, 'text_padding_bottom') . 'px';
                         }
                         if (Journal2Utils::getProperty($caption, 'text_padding_left') !== null) {
                             $css[] = 'padding-left: ' . Journal2Utils::getProperty($caption, 'text_padding_left') . 'px';
                         }
                         if (Journal2Utils::getProperty($caption, 'text_line_height')) {
                             $css[] = 'line-height: ' . Journal2Utils::getProperty($caption, 'text_line_height') . 'px';
                         }
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:67,代码来源:journal2_slider.php

示例6: getBorderCssProperties

 public static function getBorderCssProperties($settings)
 {
     $res = array();
     $unit = Journal2Utils::getProperty($settings, 'value.border_radius_unit', 'px');
     $has_border = false;
     /* width */
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border.value.text'))) {
         $has_border = true;
         $res[] = 'border-width: ' . Journal2Utils::getProperty($settings, 'value.border.value.text') . 'px';
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_top.value.text'))) {
         $has_border = true;
         $res[] = 'border-top-width: ' . Journal2Utils::getProperty($settings, 'value.border_top.value.text') . 'px';
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_right.value.text'))) {
         $has_border = true;
         $res[] = 'border-right-width: ' . Journal2Utils::getProperty($settings, 'value.border_right.value.text') . 'px';
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_bottom.value.text'))) {
         $has_border = true;
         $res[] = 'border-bottom-width: ' . Journal2Utils::getProperty($settings, 'value.border_bottom.value.text') . 'px';
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_left.value.text'))) {
         $has_border = true;
         $res[] = 'border-left-width: ' . Journal2Utils::getProperty($settings, 'value.border_left.value.text') . 'px';
     }
     /* radius */
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_radius.value.text'))) {
         $res[] = 'border-radius: ' . Journal2Utils::getProperty($settings, 'value.border_radius.value.text') . $unit;
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_radius_top.value.text'))) {
         $res[] = 'border-top-left-radius: ' . Journal2Utils::getProperty($settings, 'value.border_radius_top.value.text') . $unit;
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_radius_right.value.text'))) {
         $res[] = 'border-top-right-radius: ' . Journal2Utils::getProperty($settings, 'value.border_radius_right.value.text') . $unit;
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_radius_bottom.value.text'))) {
         $res[] = 'border-bottom-right-radius: ' . Journal2Utils::getProperty($settings, 'value.border_radius_bottom.value.text') . $unit;
     }
     if (is_numeric(Journal2Utils::getProperty($settings, 'value.border_radius_left.value.text'))) {
         $res[] = 'border-bottom-left-radius: ' . Journal2Utils::getProperty($settings, 'value.border_radius_left.value.text') . $unit;
     }
     /* style */
     if ($has_border && Journal2Utils::getProperty($settings, 'value.border_type', 'solid')) {
         $res[] = 'border-style: ' . Journal2Utils::getProperty($settings, 'value.border_type', 'solid');
     }
     /* color */
     if (Journal2Utils::getProperty($settings, 'value.border_color.value.color')) {
         $res[] = 'border-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($settings, 'value.border_color.value.color'));
     }
     return $res;
 }
开发者ID:SwayWebStudio,项目名称:night.com,代码行数:52,代码来源:journal2_utils.php

示例7: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* device detection */
     $this->data['disable_on_classes'] = array();
     if ($this->journal2->settings->get('responsive_design')) {
         $device = Journal2Utils::getDevice();
         if (Journal2Utils::getProperty($module_data, 'enable_on_phone', '1') == '0') {
             if ($device === 'phone') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-phone';
             }
         }
         if (Journal2Utils::getProperty($module_data, 'enable_on_tablet', '1') == '0') {
             if ($device === 'tablet') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-tablet';
             }
         }
         if (Journal2Utils::getProperty($module_data, 'enable_on_desktop', '1') == '0') {
             if ($device === 'desktop') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-desktop';
             }
         }
     }
     $this->data['css'] = '';
     /* css for top / bottom positions */
     if (in_array($setting['position'], array('top', 'bottom'))) {
         $padding = $this->journal2->settings->get('module_margins', 20) . 'px';
         /* outer */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'background'));
         $css[] = 'padding-top: ' . Journal2Utils::getProperty($module_data, 'margin_top', 0) . 'px';
         $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($module_data, 'margin_bottom', 0) . 'px';
         $this->journal2->settings->set('module_journal2_cms_blocks_' . $setting['module_id'], implode('; ', $css));
         $this->journal2->settings->set('module_journal2_cms_blocks_' . $setting['module_id'] . '_classes', implode(' ', $this->data['disable_on_classes']));
         /* inner css */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'fullwidth')) {
             $css[] = 'max-width: 100%';
             $css[] = 'padding-left: ' . $padding;
             $css[] = 'padding-right: ' . $padding;
         } else {
             $css[] = 'max-width: ' . $this->journal2->settings->get('site_width', 1024) . 'px';
             $css = array_merge($css, Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'module_background')));
             if (Journal2Utils::getProperty($module_data, 'module_padding')) {
                 $this->data['gutter_on_class'] = 'gutter-on';
                 $css[] = 'padding: 20px';
             }
         }
         $this->data['css'] = implode('; ', $css);
     }
     $cache_property = "module_journal_cms_blocks_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}";
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         /* set global module properties */
         $this->data['module'] = $module;
         $this->data['title'] = Journal2Utils::getProperty($module_data, 'module_title.value.' . $this->config->get('config_language_id'), '');
         /* sort sections */
         $sections = Journal2Utils::getProperty($module_data, 'sections', array());
         $sections = Journal2Utils::sortArray($sections);
         /* generate sections */
         $this->data['sections'] = array();
         foreach ($sections as $section) {
             if (!$section['status']) {
                 continue;
             }
             $css = array();
             if (Journal2Utils::getColor(Journal2Utils::getProperty($section, 'icon_bg_color.value.color'))) {
                 $css[] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($section, 'icon_bg_color.value.color'));
             }
             if (Journal2Utils::getProperty($section, 'icon_width')) {
                 $css[] = 'width: ' . Journal2Utils::getProperty($section, 'icon_width') . 'px';
             }
             if (Journal2Utils::getProperty($section, 'icon_height')) {
                 $css[] = 'height: ' . Journal2Utils::getProperty($section, 'icon_height') . 'px';
                 $css[] = 'line-height: ' . Journal2Utils::getProperty($section, 'icon_height') . 'px';
             }
             if (Journal2Utils::getProperty($section, 'icon_border')) {
                 $css = array_merge($css, Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($section, 'icon_border')));
             }
             if ($color = Journal2Utils::getProperty($section, 'bg_color.value.color')) {
                 $color = 'background-color: ' . Journal2Utils::getColor($color);
             } else {
                 $color = null;
             }
             $this->data['sections'][] = array('css' => $color, 'has_icon' => Journal2Utils::getProperty($section, 'icon_status'), 'icon_position' => Journal2Utils::getProperty($section, 'icon_position', 'top'), 'icon' => Journal2Utils::getIconOptions2(Journal2Utils::getProperty($section, 'icon')), 'icon_css' => implode('; ', $css), 'type' => 'html', 'title' => Journal2Utils::getProperty($section, 'section_title.value.' . $this->config->get('config_language_id'), ''), 'content_align' => Journal2Utils::getProperty($section, 'text_align', 'left'), 'content' => Journal2Utils::getProperty($section, 'text.' . $this->config->get('config_language_id'), 'Not Translated'));
//.........这里部分代码省略.........
开发者ID:SwayWebStudio,项目名称:night.com,代码行数:101,代码来源:journal2_cms_blocks.php

示例8: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* hide on mobile */
     if (Journal2Utils::getProperty($module_data, 'disable_mobile') && (Journal2Cache::$mobile_detect->isMobile() && !Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
         return;
     }
     /* hide on desktop */
     if (Journal2Utils::getProperty($module_data, 'disable_desktop') && !Journal2Cache::$mobile_detect->isMobile()) {
         return;
     }
     $this->data['cookie_name'] = 'header_notice-' . Journal2Utils::getProperty($module_data, 'do_not_show_again_cookie');
     $this->data['do_not_show_again'] = Journal2Utils::getProperty($module_data, 'do_not_show_again', '1');
     if ($this->data['do_not_show_again'] && isset($this->request->cookie[$this->data['cookie_name']])) {
         return;
     }
     $cache_property = "module_journal_header_notice_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}";
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         $this->data['hide_on_mobile_class'] = Journal2Utils::getProperty($module_data, 'disable_mobile') ? 'hide-on-mobile' : '';
         /* set global module properties */
         $this->data['module'] = $module;
         $this->data['text'] = Journal2Utils::getProperty($module_data, 'text.value.' . $this->config->get('config_language_id'));
         $this->data['icon'] = Journal2Utils::getIconOptions2(Journal2Utils::getProperty($module_data, 'icon'));
         $this->data['icon_position'] = Journal2Utils::getProperty($module_data, 'icon_position', 'left');
         $this->data['float_icon'] = Journal2Utils::getProperty($module_data, 'float_icon', '0') == '1' ? 'floated-icon' : '';
         $this->data['fullwidth'] = Journal2Utils::getProperty($module_data, 'fullwidth', '0') == '1' ? 'fullwidth-notice' : '';
         $this->data['close_button_type'] = Journal2Utils::getProperty($module_data, 'close_button_type', 'icon');
         $this->data['close_button_text'] = Journal2Utils::getProperty($module_data, 'close_button_text.value.' . $this->config->get('config_language_id'), 'Close');
         $css = array();
         if (($value = Journal2Utils::getProperty($module_data, 'padding_t.value.text')) !== null) {
             $css[] = 'padding-top: ' . $value . 'px';
         }
         if (($value = Journal2Utils::getProperty($module_data, 'padding_r.value.text')) !== null) {
             $css[] = 'padding-right: ' . $value . 'px';
         }
         if (($value = Journal2Utils::getProperty($module_data, 'padding_b.value.text')) !== null) {
             $css[] = 'padding-bottom: ' . $value . 'px';
         }
         if (($value = Journal2Utils::getProperty($module_data, 'padding_l.value.text')) !== null) {
             $css[] = 'padding-left: ' . $value . 'px';
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') === 'google') {
             $font_name = Journal2Utils::getProperty($module_data, 'text_font.value.font_name');
             $font_subset = Journal2Utils::getProperty($module_data, 'text_font.value.font_subset');
             $font_weight = Journal2Utils::getProperty($module_data, 'text_font.value.font_weight');
             $this->journal2->google_fonts->add($font_name, $font_subset, $font_weight);
             $this->google_fonts[] = array('name' => $font_name, 'subset' => $font_subset, 'weight' => $font_weight);
             $weight = filter_var(Journal2Utils::getProperty($module_data, 'text_font.value.font_weight'), FILTER_SANITIZE_NUMBER_INT);
             $css[] = 'font-weight: ' . ($weight ? $weight : 400);
             $css[] = "font-family: '" . Journal2Utils::getProperty($module_data, 'text_font.value.font_name') . "'";
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') === 'system') {
             $css[] = 'font-weight: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_weight');
             $css[] = 'font-family: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_family');
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.font_type') !== 'none') {
             $css[] = 'font-size: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_size');
             $css[] = 'font-style: ' . Journal2Utils::getProperty($module_data, 'text_font.value.font_style');
             $css[] = 'text-transform: ' . Journal2Utils::getProperty($module_data, 'text_font.value.text_transform');
         }
         if (Journal2Utils::getProperty($module_data, 'text_font.value.color.value.color')) {
             $css[] = 'color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'text_font.value.color.value.color'));
         }
         if ($color = Journal2Utils::getProperty($module_data, 'text_background_color.value.color')) {
             $css[] = "background-color: " . Journal2Utils::getColor($color);
         }
         $this->data['css'] = implode('; ', $css);
         $global_style = array();
         /* link colors */
         if ($color = Journal2Utils::getProperty($module_data, 'text_link_color.value.color')) {
             $global_style[] = "#journal-header-notice-{$module} a { color: " . Journal2Utils::getColor($color) . "}";
         }
         if ($color = Journal2Utils::getProperty($module_data, 'text_link_hover_color.value.color')) {
             $global_style[] = "#journal-header-notice-{$module} a:hover { color: " . Journal2Utils::getColor($color) . "}";
         }
         /* button colors */
         if ($color = Journal2Utils::getProperty($module_data, 'button_color.value.color')) {
             $global_style[] = "#journal-header-notice-{$module} .close-notice { color: " . Journal2Utils::getColor($color) . "}";
         }
         if ($color = Journal2Utils::getProperty($module_data, 'button_hover_color.value.color')) {
             $global_style[] = "#journal-header-notice-{$module} .close-notice:hover { color: " . Journal2Utils::getColor($color) . "}";
         }
         if ($color = Journal2Utils::getProperty($module_data, 'button_bg_color.value.color')) {
             $global_style[] = "#journal-header-notice-{$module} .close-notice { background-color: " . Journal2Utils::getColor($color) . "}";
         }
         if ($color = Journal2Utils::getProperty($module_data, 'button_hover_bg_color.value.color')) {
             $global_style[] = "#journal-header-notice-{$module} .close-notice:hover { background-color: " . Journal2Utils::getColor($color) . "}";
         }
         $this->data['global_style'] = $global_style;
//.........这里部分代码省略.........
开发者ID:nabeelkausari,项目名称:beelzak,代码行数:101,代码来源:journal2_header_notice.php

示例9: footer

 public function footer($menu)
 {
     $cache_property = 'config_' . $menu;
     $cache = $this->journal2->cache->get($cache_property);
     $has_random_products = false;
     if ($cache === null || self::$CACHEABLE !== true) {
         $rows = $this->journal2->settings->get('config_' . $menu . '.rows', array());
         $rows = Journal2Utils::sortArray($rows);
         $this->data['rows'] = array();
         foreach ($rows as $row) {
             if (isset($row['status']) && !$row['status']) {
                 continue;
             }
             if ($class = Journal2Utils::getProperty($row, 'disable_mobile') ? 'hide-on-mobile' : '') {
                 if ((Journal2Cache::$mobile_detect->isMobile() || Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
                     continue;
                 }
             }
             if (Journal2Utils::getProperty($row, 'disable_desktop') && !Journal2Cache::$mobile_detect->isMobile()) {
                 continue;
             }
             $row_css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($row, 'background'));
             if (Journal2Utils::getProperty($row, 'bottom_spacing') !== null) {
                 $row_css[] = 'margin-bottom: ' . Journal2Utils::getProperty($row, 'bottom_spacing') . 'px';
             }
             if (Journal2Utils::getProperty($row, 'padding_top') !== null) {
                 $row_css[] = 'padding-top: ' . Journal2Utils::getProperty($row, 'padding_top') . 'px';
             }
             if (Journal2Utils::getProperty($row, 'padding_right') !== null) {
                 $row_css[] = 'padding-right: ' . Journal2Utils::getProperty($row, 'padding_right') . 'px';
             }
             if (Journal2Utils::getProperty($row, 'padding_bottom') !== null) {
                 $row_css[] = 'padding-bottom: ' . Journal2Utils::getProperty($row, 'padding_bottom') . 'px';
             }
             if (Journal2Utils::getProperty($row, 'padding_left') !== null) {
                 $row_css[] = 'padding-left: ' . Journal2Utils::getProperty($row, 'padding_left') . 'px';
             }
             $temp = array('type' => '', 'css' => implode('; ', $row_css), 'class' => $class, 'columns' => array(), 'contacts' => array('left' => array(), 'right' => array()));
             switch (Journal2Utils::getProperty($row, 'type')) {
                 case 'columns':
                     $temp['type'] = 'columns';
                     $columns = Journal2Utils::getProperty($row, 'columns');
                     $columns = Journal2Utils::sortArray($columns);
                     $temp['classes'] = Journal2Utils::getProductGridClasses(Journal2Utils::getProperty($row, 'items_per_row.value'), $this->journal2->settings->get('site_width', 1024), 0);
                     foreach ($columns as $column) {
                         if (isset($column['status']) && !$column['status']) {
                             continue;
                         }
                         if ($class = Journal2Utils::getProperty($column, 'disable_mobile') ? 'hide-on-mobile' : '') {
                             if ((Journal2Cache::$mobile_detect->isMobile() || Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
                                 continue;
                             }
                         }
                         if (Journal2Utils::getProperty($column, 'disable_desktop') && !Journal2Cache::$mobile_detect->isMobile()) {
                             continue;
                         }
                         switch (Journal2Utils::getProperty($column, 'type')) {
                             case 'text':
                                 /* icon css */
                                 $css = array();
                                 if (Journal2Utils::getColor(Journal2Utils::getProperty($column, 'icon_bg_color.value.color'))) {
                                     $css[] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($column, 'icon_bg_color.value.color'));
                                 }
                                 if (Journal2Utils::getProperty($column, 'icon_width')) {
                                     $css[] = 'width: ' . Journal2Utils::getProperty($column, 'icon_width') . 'px';
                                 }
                                 if (Journal2Utils::getProperty($column, 'icon_height')) {
                                     $css[] = 'height: ' . Journal2Utils::getProperty($column, 'icon_height') . 'px';
                                     $css[] = 'line-height: ' . Journal2Utils::getProperty($column, 'icon_height') . 'px';
                                 }
                                 if (Journal2Utils::getProperty($column, 'icon_border')) {
                                     $css = array_merge($css, Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($column, 'icon_border')));
                                 }
                                 $temp['columns'][] = array('class' => $class, 'type' => Journal2Utils::getProperty($column, 'type', 'text'), 'title' => Journal2Utils::getProperty($column, 'title.value.' . $this->config->get('config_language_id')), 'text' => Journal2Utils::getProperty($column, 'text.' . $this->config->get('config_language_id')), 'has_icon' => Journal2Utils::getProperty($column, 'icon_status'), 'icon_position' => Journal2Utils::getProperty($column, 'icon_position', 'top'), 'icon' => Journal2Utils::getIconOptions2(Journal2Utils::getProperty($column, 'icon')), 'icon_css' => implode('; ', $css));
                                 break;
                             case 'menu':
                                 $temp['columns'][] = array('class' => $class, 'type' => Journal2Utils::getProperty($column, 'type', 'text'), 'title' => Journal2Utils::getProperty($column, 'title.value.' . $this->config->get('config_language_id')), 'items' => $this->generateMenu(Journal2Utils::getProperty($column, 'items', array())));
                                 break;
                             case 'newsletter':
                                 $temp['columns'][] = array('class' => $class, 'type' => Journal2Utils::getProperty($column, 'type', 'text'), 'title' => Journal2Utils::getProperty($column, 'title.value.' . $this->config->get('config_language_id')), 'content' => $this->getChild('module/journal2_newsletter', array('module_id' => Journal2Utils::getProperty($column, 'newsletter_id'), 'layout_id' => -1, 'position' => 'footer')));
                                 break;
                             case 'products':
                                 $products = array();
                                 $limit = Journal2Utils::getProperty($column, 'items_limit', 5);
                                 $this->data['image_width'] = $this->journal2->settings->get('footer_product_image_width', 50);
                                 $this->data['image_height'] = $this->journal2->settings->get('footer_product_image_height', 50);
                                 $this->data['image_resize_type'] = $this->journal2->settings->get('footer_product_image_type', 'fit');
                                 $this->data['text_tax'] = $this->language->get('text_tax');
                                 $this->data['button_cart'] = $this->language->get('button_cart');
                                 $this->data['button_wishlist'] = $this->language->get('button_wishlist');
                                 $this->data['button_compare'] = $this->language->get('button_compare');
                                 switch (Journal2Utils::getProperty($column, 'section_type')) {
                                     case 'module':
                                         switch (Journal2Utils::getProperty($column, 'module_type')) {
                                             case 'featured':
                                                 $products = $this->model_journal2_product->getFeatured($limit, Journal2Utils::getProperty($column, 'featured_module_id'));
                                                 break;
                                             case 'bestsellers':
                                                 $products = $this->model_journal2_product->getBestsellers($limit);
                                                 break;
//.........这里部分代码省略.........
开发者ID:nabeelkausari,项目名称:beelzak,代码行数:101,代码来源:menu.php

示例10: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* device detection */
     $this->data['disable_on_classes'] = array();
     if ($this->journal2->settings->get('responsive_design')) {
         $device = Journal2Utils::getDevice();
         if (Journal2Utils::getProperty($module_data, 'enable_on_phone', '1') == '0') {
             if ($device === 'phone') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-phone';
             }
         }
         if (Journal2Utils::getProperty($module_data, 'enable_on_tablet', '1') == '0') {
             if ($device === 'tablet') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-tablet';
             }
         }
         if (Journal2Utils::getProperty($module_data, 'enable_on_desktop', '1') == '0') {
             if ($device === 'desktop') {
                 return;
             } else {
                 $this->data['disable_on_classes'][] = 'hide-on-desktop';
             }
         }
     }
     $this->data['css'] = '';
     /* css for top / bottom positions */
     if (in_array($setting['position'], array('top', 'bottom'))) {
         $padding = $this->journal2->settings->get('module_margins', 20) . 'px';
         /* outer */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'background'));
         $css[] = 'padding-top: ' . Journal2Utils::getProperty($module_data, 'margin_top', 0) . 'px';
         $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($module_data, 'margin_bottom', 0) . 'px';
         $this->journal2->settings->set('module_journal2_custom_sections_' . $setting['module_id'], implode('; ', $css));
         $this->journal2->settings->set('module_journal2_custom_sections_' . $setting['module_id'] . '_classes', implode(' ', $this->data['disable_on_classes']));
         /* inner css */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'fullwidth')) {
             $css[] = 'max-width: 100%';
             $css[] = 'padding-left: ' . $padding;
             $css[] = 'padding-right: ' . $padding;
         } else {
             $css[] = 'max-width: ' . $this->journal2->settings->get('site_width', 1024) . 'px';
             $css = array_merge($css, Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'module_background')));
             if (Journal2Utils::getProperty($module_data, 'module_padding')) {
                 $this->data['gutter_on_class'] = 'gutter-on';
                 $css[] = 'padding: 20px';
             }
         }
         $this->data['css'] = implode('; ', $css);
     }
     $cache_property = "module_journal_custom_sections_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}" . $this->journal2->cache->getRouteCacheKey();
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $module = mt_rand();
         /* set global module properties */
         $this->data['module'] = $module;
         $this->data['show_title'] = Journal2Utils::getProperty($module_data, 'show_title');
         $this->data['show_title_class'] = $this->data['show_title'] ? '' : 'no-heading';
         $this->data['brand_name'] = Journal2Utils::getProperty($module_data, 'brand_name');
         $this->data['module_type'] = Journal2Utils::getProperty($module_data, 'module_type');
         $this->data['render_as'] = Journal2Utils::getProperty($module_data, 'display_as');
         $this->data['default_section'] = '';
         /* generate sections */
         $this->data['sections'] = array();
         $this->data['items'] = array();
         /* image dimensions */
         $this->data['image_width'] = Journal2Utils::getProperty($module_data, 'image_width', $this->config->get('config_image_product_width'));
         $this->data['image_height'] = Journal2Utils::getProperty($module_data, 'image_height', $height = $this->config->get('config_image_product_height'));
         $this->data['image_resize_type'] = Journal2Utils::getProperty($module_data, 'image_type', 'fit');
         $this->data['dummy_image'] = $this->model_tool_image->resize('data/journal2/transparent.png', $this->data['image_width'], $this->data['image_height']);
         /* image border */
         if (Journal2Utils::getProperty($module_data, 'image_border')) {
             $this->data['image_border_css'] = implode('; ', Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($module_data, 'image_border')));
         } else {
             $this->data['image_border_css'] = null;
         }
         /* image background color */
         if (Journal2Utils::getProperty($module_data, 'image_bgcolor.value.color')) {
             $this->data['image_bgcolor'] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'image_bgcolor.value.color'));
         } else {
             $this->data['image_bgcolor'] = null;
         }
         switch ($this->data['module_type']) {
             case 'product':
                 $sections = Journal2Utils::getProperty($module_data, 'product_sections', array());
                 $sections = Journal2Utils::sortArray($sections);
//.........这里部分代码省略.........
开发者ID:SwayWebStudio,项目名称:night.com,代码行数:101,代码来源:journal2_custom_sections.php

示例11: index

 public function index($setting)
 {
     if (!defined('JOURNAL_INSTALLED')) {
         return;
     }
     Journal2::startTimer(get_class($this));
     /* get module data from db */
     $module_data = $this->model_journal2_module->getModule($setting['module_id']);
     if (!$module_data || !isset($module_data['module_data']) || !$module_data['module_data']) {
         return;
     }
     $module_data = $module_data['module_data'];
     /* hide on mobile */
     if (Journal2Utils::getProperty($module_data, 'disable_mobile') && (Journal2Cache::$mobile_detect->isMobile() && !Journal2Cache::$mobile_detect->isTablet()) && $this->journal2->settings->get('responsive_design')) {
         return;
     }
     /* hide on desktop */
     if (Journal2Utils::getProperty($module_data, 'disable_desktop') && !Journal2Cache::$mobile_detect->isMobile()) {
         return;
     }
     $this->data['css'] = '';
     /* css for top / bottom positions */
     if (in_array($setting['position'], array('top', 'bottom'))) {
         $padding = $this->journal2->settings->get('module_margins', 20) . 'px';
         /* outer */
         $css = Journal2Utils::getBackgroundCssProperties(Journal2Utils::getProperty($module_data, 'background'));
         $css[] = 'padding-top: ' . Journal2Utils::getProperty($module_data, 'margin_top', 0) . 'px';
         $css[] = 'padding-bottom: ' . Journal2Utils::getProperty($module_data, 'margin_bottom', 0) . 'px';
         $this->journal2->settings->set('module_journal2_newsletter_' . $setting['module_id'], implode('; ', $css));
         /* inner css */
         $css = array();
         if (Journal2Utils::getProperty($module_data, 'fullwidth')) {
             $css[] = 'max-width: 100%';
             $css[] = 'padding-left: ' . $padding;
             $css[] = 'padding-right: ' . $padding;
         } else {
             $css[] = 'max-width: ' . $this->journal2->settings->get('site_width', 1024) . 'px';
         }
         $this->data['css'] = implode('; ', $css);
     }
     /* border */
     if (Journal2Utils::getProperty($module_data, 'module_border')) {
         $border = implode('; ', Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($module_data, 'module_border')));
         $this->data['css'] = $this->data['css'] ? '; ' . $border : $border;
     }
     $cache_property = "module_journal_carousel_{$setting['module_id']}_{$setting['layout_id']}_{$setting['position']}";
     $cache = $this->journal2->cache->get($cache_property);
     if ($cache === null || self::$CACHEABLE !== true) {
         $this->data['module'] = mt_rand();
         $this->data['text_class'] = Journal2Utils::getProperty($module_data, 'text_position', 'left');
         /* hide on mobile */
         $this->data['hide_on_mobile_class'] = Journal2Utils::getProperty($module_data, 'disable_mobile') ? 'hide-on-mobile' : '';
         /* heading title */
         $this->data['heading_title'] = Journal2Utils::getProperty($module_data, 'module_title.value.' . $this->config->get('config_language_id'));
         /* text */
         $this->data['module_text'] = Journal2Utils::getProperty($module_data, 'module_text.value.' . $this->config->get('config_language_id'));
         $font_css = array();
         if (Journal2Utils::getProperty($module_data, 'module_text_font.value.font_type') === 'google') {
             $font_name = Journal2Utils::getProperty($module_data, 'module_text_font.value.font_name');
             $font_subset = Journal2Utils::getProperty($module_data, 'module_text_font.value.font_subset');
             $font_weight = Journal2Utils::getProperty($module_data, 'module_text_font.value.font_weight');
             $this->journal2->google_fonts->add($font_name, $font_subset, $font_weight);
             $this->google_fonts[] = array('name' => $font_name, 'subset' => $font_subset, 'weight' => $font_weight);
             $weight = filter_var(Journal2Utils::getProperty($module_data, 'module_text_font.value.font_weight'), FILTER_SANITIZE_NUMBER_INT);
             $font_css[] = 'font-weight: ' . ($weight ? $weight : 400);
             $font_css[] = "font-family: '" . Journal2Utils::getProperty($module_data, 'module_text_font.value.font_name') . "'";
         }
         if (Journal2Utils::getProperty($module_data, 'module_text_font.value.font_type') === 'system') {
             $font_css[] = 'font-weight: ' . Journal2Utils::getProperty($module_data, 'module_text_font.value.font_weight');
             $font_css[] = 'font-family: ' . Journal2Utils::getProperty($module_data, 'module_text_font.value.font_family');
         }
         if (Journal2Utils::getProperty($module_data, 'module_text_font.value.font_type') !== 'none') {
             $font_css[] = 'font-size: ' . Journal2Utils::getProperty($module_data, 'module_text_font.value.font_size');
             $font_css[] = 'font-style: ' . Journal2Utils::getProperty($module_data, 'module_text_font.value.font_style');
             $font_css[] = 'text-transform: ' . Journal2Utils::getProperty($module_data, 'module_text_font.value.text_transform');
         }
         if (Journal2Utils::getProperty($module_data, 'module_text_font.value.color.value.color')) {
             $font_css[] = 'color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'module_text_font.value.color.value.color'));
         }
         $this->data['font_css'] = implode('; ', $font_css);
         /* input */
         $this->data['input_placeholder'] = Journal2Utils::getProperty($module_data, 'input_placeholder.value.' . $this->config->get('config_language_id'));
         $input_style = array();
         if (Journal2Utils::getProperty($module_data, 'input_height')) {
             $input_style[] = 'height: ' . Journal2Utils::getProperty($module_data, 'input_height') . 'px';
         }
         $input_field_style = array();
         if (Journal2Utils::getProperty($module_data, 'input_bg_color.value.color')) {
             $input_field_style[] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($module_data, 'input_bg_color.value.color'));
         }
         if (Journal2Utils::getProperty($module_data, 'input_border')) {
             $input_field_style = array_merge($input_field_style, Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($module_data, 'input_border')));
         }
         if (Journal2Utils::getProperty($module_data, 'input_font.value.font_type') === 'google') {
             $font_name = Journal2Utils::getProperty($module_data, 'input_font.value.font_name');
             $font_subset = Journal2Utils::getProperty($module_data, 'input_font.value.font_subset');
             $font_weight = Journal2Utils::getProperty($module_data, 'input_font.value.font_weight');
             $this->journal2->google_fonts->add($font_name, $font_subset, $font_weight);
             $this->google_fonts[] = array('name' => $font_name, 'subset' => $font_subset, 'weight' => $font_weight);
             $weight = filter_var(Journal2Utils::getProperty($module_data, 'input_font.value.font_weight'), FILTER_SANITIZE_NUMBER_INT);
//.........这里部分代码省略.........
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:101,代码来源:journal2_newsletter.php

示例12: getButtonStyle

 private function getButtonStyle($module_data, $property, $default = '')
 {
     $style = $this->getFontSettings($module_data, $property . '_font');
     if ($color = Journal2Utils::getProperty($module_data, $property . '_bgcolor.value.color')) {
         $style[] = 'background-color: ' . Journal2Utils::getColor($color);
     }
     $hover_style = array();
     if ($color = Journal2Utils::getProperty($module_data, $property . '_hover_bgcolor.value.color')) {
         $hover_style[] = 'background-color: ' . Journal2Utils::getColor($color) . ' !important';
     }
     return array('status' => Journal2Utils::getProperty($module_data, $property), 'text' => Journal2Utils::getProperty($module_data, $property . '_text.value.' . $this->config->get('config_language_id'), $default), 'icon' => Journal2Utils::getIconOptions2(Journal2Utils::getProperty($module_data, $property . '_icon')), 'icon_position' => Journal2Utils::getProperty($module_data, $property . '_icon_position', 'right'), 'link' => $this->model_journal2_menu->getLink(Journal2Utils::getProperty($module_data, $property . '_link')), 'target' => Journal2Utils::getProperty($module_data, $property . '_new_window') ? 'target="_blank"' : '', 'style' => implode('; ', $style), 'hover_style' => implode('; ', $hover_style));
 }
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:12,代码来源:journal2_popup.php

示例13: addCpSettings

 private function addCpSettings($setting)
 {
     switch ($setting['type']) {
         case 'j-opt-color':
         case 'j-opt-color-gradient':
             if (Journal2Utils::getProperty($setting, 'value.color') !== null) {
                 $this->journal2->settings->set($setting['name'], Journal2Utils::getColor(Journal2Utils::getProperty($setting, 'value.color')));
             }
             break;
         case 'j-opt-text':
             if (Journal2Utils::getProperty($setting, 'value.text') !== null) {
                 $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value.text'));
             }
             break;
         case 'j-opt-textarea':
             if (Journal2Utils::getProperty($setting, 'value.text') !== null) {
                 $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value.text'));
             }
             break;
         case 'j-opt-text-lang':
             if (Journal2Utils::getProperty($setting, 'value') !== null) {
                 $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value.' . $this->config->get('config_language_id')));
             }
             break;
         case 'j-opt-image':
             if (Journal2Utils::getProperty($setting, 'value.image') !== null) {
                 $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value.image'));
             }
             break;
         case 'j-opt-select':
             if (Journal2Utils::getProperty($setting, 'value') !== null) {
                 $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value'));
             }
             break;
         case 'j-opt-font':
         case 'j-opt-border':
             break;
         case 'j-opt-background':
             break;
         case 'j-opt-icon':
             $icon = Journal2Utils::getIconOptions2(Journal2Utils::getProperty($setting, 'value'));
             $this->journal2->settings->set($setting['name'], $icon);
             break;
         case 'j-opt-items-per-row':
             $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value'));
             break;
         case 'j-opt-slider':
             $this->journal2->settings->set($setting['name'], Journal2Utils::getProperty($setting, 'value'));
             break;
         case 'j-opt-sharethis':
             $share_this_data = json_decode(file_get_contents(DIR_SYSTEM . 'journal2/data/share_this.json'), true);
             $items = array();
             foreach ($setting as $k => $v) {
                 if (is_numeric($k)) {
                     $items[] = array('class' => 'st_' . str_replace('st_li_', '', $v['id']), 'name' => $share_this_data[$v['id']]['name']);
                 }
             }
             $this->journal2->settings->set('config_share_buttons', $items);
             break;
         default:
             trigger_error($setting['type'] . ' not parsed!');
     }
     return false;
 }
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:64,代码来源:settings.php

示例14: index

 public function index()
 {
     if ($this->journal2->page->getType() !== 'product' && $this->journal2->page->getType() !== 'quickview') {
         return;
     }
     Journal2::startTimer('ProductTabs');
     $product_id = $this->journal2->page->getId();
     /* recently viewed */
     $recently_viewed = isset($this->request->cookie['jrv']) && $this->request->cookie['jrv'] ? explode(',', $this->request->cookie['jrv']) : array();
     $recently_viewed = array_diff($recently_viewed, array($product_id));
     array_unshift($recently_viewed, $product_id);
     $recently_viewed = array_splice($recently_viewed, 0, 10);
     setcookie('jrv', implode(',', $recently_viewed), time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
     $tabs = $this->model_journal2_module->getProductTabs($product_id);
     $tabs = Journal2Utils::sortArray($tabs);
     $product_info = $this->model_catalog_product->getProduct($product_id);
     $tab_tab = array();
     $tab_desc_top = array();
     $tab_desc_bottom = array();
     $tab_image = array();
     $tab_enquiry = array();
     foreach ($tabs as $tab) {
         if (!$tab['status']) {
             continue;
         }
         $css = array();
         if (Journal2Utils::getColor(Journal2Utils::getProperty($tab, 'icon_bg_color.value.color'))) {
             $css[] = 'background-color: ' . Journal2Utils::getColor(Journal2Utils::getProperty($tab, 'icon_bg_color.value.color'));
         }
         if (Journal2Utils::getProperty($tab, 'icon_width')) {
             $css[] = 'width: ' . Journal2Utils::getProperty($tab, 'icon_width') . 'px';
         }
         if (Journal2Utils::getProperty($tab, 'icon_height')) {
             $css[] = 'height: ' . Journal2Utils::getProperty($tab, 'icon_height') . 'px';
             $css[] = 'line-height: ' . Journal2Utils::getProperty($tab, 'icon_height') . 'px';
         }
         if (Journal2Utils::getProperty($tab, 'icon_border')) {
             $css = array_merge($css, Journal2Utils::getBorderCssProperties(Journal2Utils::getProperty($tab, 'icon_border')));
         }
         $position = Journal2Utils::getProperty($tab, 'position');
         $name = Journal2Utils::getProperty($tab, 'name.value.' . $this->config->get('config_language_id'));
         $has_icon = Journal2Utils::getProperty($tab, 'icon_status');
         $icon = Journal2Utils::getIconOptions2(Journal2Utils::getProperty($tab, 'icon'));
         $icon_css = implode('; ', $css);
         switch (Journal2Utils::getProperty($tab, 'content_type', 'custom')) {
             case 'custom':
                 $content = Journal2Utils::getProperty($tab, 'content.' . $this->config->get('config_language_id'));
                 break;
             case 'description':
                 $content = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
                 $this->journal2->settings->set('hide_product_description', true);
                 break;
             case 'enquiry':
                 $position = 'enquiry';
                 $this->journal2->settings->set('hide_add_to_cart_button', true);
                 $href = "javascript:Journal.openPopup('" . (int) Journal2Utils::getProperty($tab, 'popup') . "', '" . $product_id . "')";
                 $content = "<a class=\"button enquiry-button\" href=\"{$href}\">{$icon}{$name}</a>";
                 break;
         }
         $position_desc = $position === 'desc' ? '_' . Journal2Utils::getProperty($tab, 'option_position') : '';
         $data = array('name' => $name, 'has_icon' => $has_icon, 'icon' => $icon, 'icon_css' => $icon_css, 'content' => $content);
         $var = 'tab_' . $position . $position_desc;
         array_push(${$var}, $data);
     }
     $this->journal2->settings->set('additional_product_tabs', $tab_tab);
     $this->journal2->settings->set('additional_product_description_top', $tab_desc_top);
     $this->journal2->settings->set('additional_product_description_bottom', $tab_desc_bottom);
     $this->journal2->settings->set('additional_product_description_image', $tab_image);
     $this->journal2->settings->set('additional_product_enquiry', $tab_enquiry);
     Journal2::stopTimer('ProductTabs');
 }
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:71,代码来源:product_tabs.php


注:本文中的Journal2Utils::getColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。