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


PHP Theme::get方法代码示例

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


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

示例1: button

 /**
  * generates HTML for apy buton
  * @param  Model_Order $order 
  * @return string                 
  */
 public static function button(Model_Order $order)
 {
     if (Core::config('payment.stripe_private') != '' and Core::config('payment.stripe_public') != '' and Theme::get('premium') == 1) {
         return View::factory('pages/stripe/button', array('order' => $order));
     }
     return '';
 }
开发者ID:nick-catanchin-ie,项目名称:common,代码行数:12,代码来源:stripeko.php

示例2: url

 /**
  * Attach theme paths to a local Url. The Url must be a resource located on the asset path
  * of the current theme or it's parents. 
  *
  * @param  string $url
  * @return string
  */
 public function url($url)
 {
     // return external URLs unmodified
     if (preg_match('/^((http(s?):)?\\/\\/)/i', $url)) {
         return $url;
     }
     // Is it on AWS? Dont lookup parent themes...
     if (preg_match('/^((http(s?):)?\\/\\/)/i', $this->assetPath)) {
         return $this->assetPath . '/' . ltrim($url, '/');
     }
     // Lookup asset in current's theme asset path
     $fullUrl = (empty($this->assetPath) ? '' : '/') . $this->assetPath . '/' . ltrim($url, '/');
     if (file_exists($fullPath = public_path($fullUrl))) {
         return $fullUrl;
     }
     // If not found then lookup in parent's theme asset path
     if ($this->getParent()) {
         return $this->getParent()->url($url);
     }
     // Asset not found at all. Error handling
     $action = \Config::get('themes.asset_not_found', 'LOG_ERROR');
     if ($action == 'THROW_EXCEPTION') {
         throw new themeException("Asset not found [{$url}]");
     } elseif ($action == 'LOG_ERROR') {
         \Log::warning("Asset not found [{$url}] in Theme [" . \Theme::get() . "]");
     }
 }
开发者ID:dlepaux,项目名称:laravel-theme,代码行数:34,代码来源:Theme.php

示例3: action_index

 public function action_index()
 {
     //template header
     $this->template->title = '';
     // $this->template->meta_keywords    = 'keywords';
     $this->template->meta_description = Core::config('general.site_description');
     //setting main view/template and render pages
     // swith to decide on ads_in_home
     $ads = new Model_Ad();
     $ads->where('status', '=', Model_Ad::STATUS_PUBLISHED);
     switch (core::config('advertisement.ads_in_home')) {
         case 2:
             $id_ads = array_keys(Model_Visit::popular_ads());
             if (count($id_ads) > 0) {
                 $ads->where('id_ad', 'IN', $id_ads);
             }
             break;
         case 1:
             $ads->where('featured', 'IS NOT', NULL)->where('featured', 'BETWEEN', array(DB::expr('NOW()'), Date::unix2mysql(time() + core::config('payment.featured_days') * 24 * 60 * 60)))->order_by('featured', 'desc');
             break;
         case 0:
         default:
             $ads->order_by('published', 'desc');
             break;
     }
     //if ad have passed expiration time dont show
     if (core::config('advertisement.expire_date') > 0) {
         $ads->where(DB::expr('DATE_ADD( published, INTERVAL ' . core::config('advertisement.expire_date') . ' DAY)'), '>', DB::expr('NOW()'));
     }
     $ads = $ads->limit(Theme::get('num_home_latest_ads', 4))->cached()->find_all();
     $this->ads = $ads;
     $categs = Model_Category::get_category_count();
     $this->template->bind('content', $content);
     $this->template->content = View::factory('pages/home', array('ads' => $ads, 'categs' => $categs));
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:35,代码来源:home.php

示例4: form

 /**
  * generates HTML form
  * @param  Model_Product $order 
  * @return string                 
  */
 public static function form(Model_Order $order)
 {
     if (Core::config('payment.authorize_login') != '' and Core::config('payment.authorize_key') != '' and Auth::instance()->logged_in() and $order->loaded() and Theme::get('premium') == 1) {
         return View::factory('pages/authorize/form', array('order' => $order));
     }
     return '';
 }
开发者ID:Ryanker,项目名称:open-eshop,代码行数:12,代码来源:authorize.php

示例5: button

 /**
  * generates HTML for apy buton
  * @param  Model_Order $order 
  * @return string                 
  */
 public static function button(Model_Order $order)
 {
     if (Core::config('payment.bitpay_apikey') != '' and Theme::get('premium') == 1 and Auth::instance()->logged_in() and $order->loaded()) {
         return View::factory('pages/bitpay/button', array('order' => $order));
     }
     return '';
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:12,代码来源:bitpay.php

示例6: before

 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  * @param  string $template view to use as template
  * @return void           
  */
 public function before($template = NULL)
 {
     Theme::checker();
     $this->maintenance();
     if ($this->auto_render === TRUE) {
         // Load the template
         $this->template = $template === NULL ? 'oc-panel/main' : $template;
         $this->template = View::factory($this->template);
         // Initialize empty values
         $this->template->title = __('Panel') . ' - ' . core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copywrite = 'Open Classifieds ' . Core::version;
         $this->template->header = View::factory('oc-panel/header');
         $this->template->content = '';
         $this->template->footer = View::factory('oc-panel/footer');
         $this->template->styles = array();
         $this->template->scripts = array();
         $this->template->user = Auth::instance()->get_user();
         //other color
         if (Theme::get('admin_theme') != 'bootstrap' and Theme::get('admin_theme') != '') {
             Theme::$styles = array('http://netdna.bootstrapcdn.com/bootswatch/3.0.0/' . Theme::get('admin_theme') . '/bootstrap.min.css' => 'screen', 'http://cdn.jsdelivr.net/bootstrap/2.3.2/css/bootstrap-responsive.min.css' => 'screen', 'http://cdn.jsdelivr.net/chosen/1.0.0/chosen.css' => 'screen', 'http://cdn.jsdelivr.net/sceditor/1.4.3/themes/default.min.css' => 'screen', 'css/admin-styles.css' => 'screen');
         } else {
             Theme::$styles = array('http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css' => 'screen', 'http://cdn.jsdelivr.net/sceditor/1.4.3/themes/default.min.css' => 'screen', 'http://cdn.jsdelivr.net/chosen/1.0.0/chosen.css' => 'screen', 'css/admin-styles.css' => 'screen');
         }
         Theme::$scripts['footer'] = array('http://code.jquery.com/jquery-1.10.2.min.js', 'js/jquery.sceditor.min.js', 'http://netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js', 'http://cdn.jsdelivr.net/chosen/1.0.0/chosen.jquery.min.js', 'js/oc-panel/theme.init.js?v=2.1', 'js/oc-panel/sidebar.js');
     }
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:34,代码来源:controller.php

示例7: index

 public function index()
 {
     $post = array('alert' => '');
     Model::load('admincp/theme');
     if ($match = Uri::match('\\/theme\\/(\\w+)')) {
         if (method_exists("controlTheme", $match[1])) {
             $method = $match[1];
             $this->{$method}();
             die;
         }
     }
     if ($match = Uri::match('\\/activate\\/(\\w+)')) {
         $theName = $match[1];
         try {
             Theme::setActivate($theName);
             $post['alert'] = '<div class="alert alert-success">Change theme success</div>';
             Redirect::to(ADMINCP_URL . 'theme');
         } catch (Exception $e) {
             $post['alert'] = '<div class="alert alert-warning">' . $e->getMessage() . '</div>';
         }
     }
     $curPage = 0;
     if ($match = Uri::match('\\/page\\/(\\d+)')) {
         $curPage = $match[1];
     }
     $post['listThemes'] = Theme::get();
     $post['theme'] = Theme::getDefault();
     System::setTitle('Theme list - ' . ADMINCP_TITLE);
     View::make('admincp/head');
     self::makeContents('themeList', $post);
     View::make('admincp/footer');
 }
开发者ID:neworldwebsites,项目名称:noblessecms,代码行数:32,代码来源:controlTheme.php

示例8: button

 /**
  * generates HTML for apy buton
  * @param  Model_Order $order 
  * @return string                 
  */
 public static function button(Model_Order $order)
 {
     if (Core::config('payment.paymill_private') != '' and Core::config('payment.paymill_public') != '' and Theme::get('premium') == 1 and $order->loaded()) {
         return View::factory('pages/paymill/button', array('order' => $order));
     }
     return '';
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:12,代码来源:paymill.php

示例9: __construct

 /**
  *
  * Contruct that checks you are loged in before nothing else happens!
  */
 function __construct(Request $request, Response $response)
 {
     if (Theme::get('premium') != 1) {
         Alert::set(Alert::INFO, __('Upgrade your Open Classifieds site to activate this feature.'));
     }
     parent::__construct($request, $response);
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:11,代码来源:plan.php

示例10: action_300

 /**
  * This function will upgrade DB that didn't existed in versions prior to 3.0.0
  */
 public function action_300()
 {
     //new configs
     $configs = array(array('config_key' => 'hide_homepage_categories', 'group_name' => 'general', 'config_value' => '{}'), array('config_key' => 'paguelofacil_cclw', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'paguelofacil_testing', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'mercadopago_client_id', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'mercadopago_client_secret', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'contact_price', 'group_name' => 'advertisement', 'config_value' => '1'), array('config_key' => 'report', 'group_name' => 'advertisement', 'config_value' => '1'), array('config_key' => 'stripe_3d_secure', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'vat_country', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'vat_number', 'group_name' => 'payment', 'config_value' => ''));
     //get theme license and add it to the config
     if (Theme::get('license') !== NULL) {
         $configs[] = array('config_key' => 'date', 'group_name' => 'license', 'config_value' => Theme::get('license_date'));
         $configs[] = array('config_key' => 'number', 'group_name' => 'license', 'config_value' => Theme::get('license'));
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET description='Hello Admin,\n\n [EMAIL.SENDER]: [EMAIL.FROM], have a message for you:\n\n [EMAIL.SUBJECT]\n\n [EMAIL.BODY] \n\n Regards!' WHERE seotitle='contact-admin'")->execute();
     } catch (exception $e) {
     }
     //crontab renew subscription
     try {
         DB::query(Database::UPDATE, "INSERT INTO `" . self::$db_prefix . "crontab` (`name`, `period`, `callback`, `params`, `description`, `active`) VALUES\n                                    ('Notify new updates', '0 9 * * 1', 'Cron_Update::notify', NULL, 'Notify by email of new site updates.', 1);")->execute();
     } catch (exception $e) {
     }
     //stripe agreement
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users` ADD `stripe_agreement` varchar(40) DEFAULT NULL")->execute();
     } catch (exception $e) {
     }
     //VAT
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "orders` ADD `VAT` varchar(20) DEFAULT NULL")->execute();
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "orders` ADD `VAT_country` varchar(20) DEFAULT NULL")->execute();
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "orders` ADD `VAT_number` varchar(20) DEFAULT NULL")->execute();
     } catch (exception $e) {
     }
     Model_Config::config_array($configs);
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:35,代码来源:update.php

示例11: form

 /**
  * generates HTML for apy buton
  * @param  Model_Order $order 
  * @return string                 
  */
 public static function form(Model_Order $order)
 {
     if (Core::config('payment.twocheckout_sid') != '' and Core::config('payment.twocheckout_secretword') != '' and Theme::get('premium') == 1) {
         $form_action = Core::config('payment.twocheckout_sandbox') == 1 ? self::url_sandbox_gateway : self::url_gateway;
         return View::factory('pages/twocheckout/form', array('order' => $order, 'form_action' => $form_action));
     }
     return '';
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:13,代码来源:twocheckout.php

示例12: __construct

 /**
  *
  * Contruct that checks you are loged in before nothing else happens!
  */
 function __construct(Request $request, Response $response)
 {
     if (Theme::get('premium') != 1) {
         Alert::set(Alert::INFO, __('Upgrade your Open Classifieds site to activate this feature.'));
         $this->redirect(Route::url('oc-panel', array('controller' => 'market')));
     }
     parent::__construct($request, $response);
 }
开发者ID:johnulist,项目名称:openclassifieds2,代码行数:12,代码来源:plan.php

示例13: __construct

 function __construct(Request $request, Response $response)
 {
     if (Theme::get('premium') != 1) {
         Alert::set(Alert::INFO, __('Upgrade your Yclas site to activate this feature.'));
     }
     $this->_filter_fields = array('id_user' => 'INPUT', 'expire_date' => 'DATE', 'created' => 'DATE', 'id_plan' => array('type' => 'SELECT', 'table' => 'plans', 'key' => 'id_plan', 'value' => 'seoname'), 'status' => array(0 => 'Inactive', 1 => 'Active'));
     parent::__construct($request, $response);
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:8,代码来源:subscription.php

示例14: button_connect

 /**
  * generates HTML for apy buton
  * @param  Model_Order $order 
  * @return string                 
  */
 public static function button_connect(Model_Order $order)
 {
     if (!empty($order->ad->user->stripe_user_id) and Core::config('payment.stripe_connect') == TRUE and Core::config('payment.stripe_private') != '' and Core::config('payment.stripe_public') != '' and Theme::get('premium') == 1) {
         if ($order->ad->price != NULL and $order->ad->price > 0 and (core::config('payment.stock') == 0 or $order->ad->stock > 0 and core::config('payment.stock') == 1)) {
             return View::factory('pages/stripe/button_connect', array('order' => $order));
         }
     }
     return '';
 }
开发者ID:ThomWensink,项目名称:common,代码行数:14,代码来源:stripeko.php

示例15: action_index

 public function action_index()
 {
     if (core::config('general.auto_locate')) {
         Theme::$scripts['footer'][] = '//maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3.7';
         Theme::$scripts['footer'][] = '//cdn.jsdelivr.net/gmaps/0.4.15/gmaps.min.js';
     }
     //template header
     $this->template->title = '';
     // $this->template->meta_keywords    = 'keywords';
     if (core::config('general.site_description') != '') {
         $this->template->meta_description = core::config('general.site_description');
     } else {
         $this->template->meta_description = core::config('general.site_name') . ' ' . __('official homepage, get your post listed now.');
     }
     //setting main view/template and render pages
     // swith to decide on ads_in_home
     $ads = new Model_Ad();
     $ads->where('status', '=', Model_Ad::STATUS_PUBLISHED);
     $ads_in_home = core::config('advertisement.ads_in_home');
     //in case we do not count visits we cant show popular
     if (core::config('advertisement.count_visits') == 0 and $ads_in_home == 2) {
         $ads_in_home = 0;
     }
     switch ($ads_in_home) {
         case 2:
             $id_ads = array_keys(Model_Visit::popular_ads());
             if (count($id_ads) > 0) {
                 $ads->where('id_ad', 'IN', $id_ads);
             }
             break;
         case 1:
             $ads->where('featured', 'IS NOT', NULL)->where('featured', '>=', Date::unix2mysql())->order_by('featured', 'desc');
             break;
         case 4:
             $ads->where('featured', 'IS NOT', NULL)->where('featured', '>=', Date::unix2mysql())->order_by(DB::expr('RAND()'));
             break;
         case 0:
         default:
             $ads->order_by('published', 'desc');
             break;
     }
     //if ad have passed expiration time dont show
     if (core::config('advertisement.expire_date') > 0) {
         $ads->where(DB::expr('DATE_ADD( published, INTERVAL ' . core::config('advertisement.expire_date') . ' DAY)'), '>', Date::unix2mysql());
     }
     $ads = $ads->limit(Theme::get('num_home_latest_ads', 4))->cached()->find_all();
     $categs = Model_Category::get_category_count();
     $locats = Model_Location::get_location_count();
     $auto_locats = NULL;
     if (core::config('general.auto_locate') and Model_User::get_userlatlng()) {
         $auto_locats = new Model_Location();
         $auto_locats = $auto_locats->select(array(DB::expr('degrees(acos(sin(radians(' . $_COOKIE['mylat'] . ')) * sin(radians(`latitude`)) + cos(radians(' . $_COOKIE['mylat'] . ')) * cos(radians(`latitude`)) * cos(radians(abs(' . $_COOKIE['mylng'] . ' - `longitude`))))) * 111.321'), 'distance'))->where('latitude', 'IS NOT', NULL)->where('longitude', 'IS NOT', NULL)->having('distance', '<=', '100')->order_by('distance', 'desc')->find_all()->as_array();
     }
     $this->template->bind('content', $content);
     $this->template->content = View::factory('pages/home', array('ads' => $ads, 'categs' => $categs, 'locats' => $locats, 'auto_locats' => $auto_locats));
 }
开发者ID:nick-catanchin-ie,项目名称:openclassifieds2,代码行数:56,代码来源:home.php


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