예제 #1
0
 protected function _beforeToHtml()
 {
     if (!$this->getTemplate()) {
         $this->setTemplate('aw_dev/auth/customerlist.phtml');
     }
     return parent::_beforeToHtml();
 }
예제 #2
0
 protected function _beforeToHtml()
 {
     if (!Mage::getStoreConfig('uioptimization/w3ccssvalidator/enabled') || !Mage::helper('core')->isDevAllowed() || strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) {
         return '';
     }
     /**
      * To force to include the PEAR libs installed in Magento (downloader/pearlib) - Without that 
      * we cannot have the Services_W3C_HTMLValidator dependencies
      * The var $pear is not used here for the moment. But the call to Varien_Pear is necessary
      */
     //$pear = Varien_Pear::getInstance (); // not compatible with Magento > 1.5
     $config = Mage::getStoreConfig('uioptimization');
     $this->_validator = new Diglin_Services_W3C_CSSValidator();
     if (!empty($config['w3ccssvalidator']['validator_uri'])) {
         $this->_validator->validator_uri = $config['w3ccssvalidator']['validator_uri'];
     }
     if (!empty($config['w3ccssvalidator']['charset'])) {
         $this->_validator->charset = $config['w3ccssvalidator']['charset'];
     }
     if (!empty($config['w3ccssvalidator']['fbd'])) {
         $this->_validator->fbc = (int) $config['w3ccssvalidator']['fbc'];
     }
     if (!empty($config['w3ccssvalidator']['doctype'])) {
         $this->_validator->doctype = $config['w3ccssvalidator']['doctype'];
     }
     if (!empty($config['w3ccssvalidator']['fbc'])) {
         $this->_validator->fbd = (int) $config['w3ccssvalidator']['fbc'];
     }
     //$this->results = $this->_validator->validate('http://www.google.com/');
     $this->results = $this->_validator->validateUri(Mage::helper('core/url')->getCurrentUrl());
     return parent::_beforeToHtml();
 }
예제 #3
0
 protected function _beforeToHtml()
 {
     $testimonials = Mage::getModel('tm_testimonials/data')->getCollection()->addFieldToFilter('status', TM_Testimonials_Model_Data::STATUS_ENABLED)->addStoreFilter(Mage::app()->getStore())->addFieldToFilter('widget', 1);
     $testimonials->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit($this->getItemsNumber());
     $this->setTestimonials($testimonials);
     return parent::_beforeToHtml();
 }
예제 #4
0
 /**
  * Setup the comments block
  *
  */
 protected function _beforeToHtml()
 {
     if (($commentsBlock = $this->getChild('comments')) !== false) {
         $commentsBlock->setPost($this->getPage());
     }
     return parent::_beforeToHtml();
 }
예제 #5
0
파일: Blocks.php 프로젝트: vstorm83/ausport
 protected function _beforeToHtml()
 {
     if (!$this->getTemplate()) {
         $this->setTemplate('aw_autorelated/blocks.phtml');
     }
     return parent::_beforeToHtml();
 }
예제 #6
0
 /**
  * Load all enabled widgets
  *
  * @return Fishpig_Wordpress_Block_Sidebar
  */
 protected function _beforeToHtml()
 {
     if (isset(self::$_lockedWidgetAreas[$this->getWidgetArea()])) {
         return $this;
     }
     self::$_lockedWidgetAreas[$this->getWidgetArea()] = true;
     if ($widgets = $this->getWidgetsArray()) {
         $this->_initAvailableWidgets();
         foreach ($widgets as $widgetType) {
             $name = $this->_getWidgetName($widgetType);
             $widgetIndex = $this->_getWidgetIndex($widgetType);
             if ($widget = $this->getWidgetType($name)) {
                 if ($block = $this->getLayout()->createBlock($widget['block'])) {
                     if (isset($widget['template']) && !empty($widget['template'])) {
                         $block->setTemplate($widget['template']);
                     }
                     $block->setWidgetType($name);
                     $block->setWidgetIndex($widgetIndex);
                     $this->setChild('wordpress_widget_' . $widgetType, $block);
                 }
             }
         }
     }
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar.phtml');
     }
     return parent::_beforeToHtml();
 }
예제 #7
0
 protected function _beforeToHtml()
 {
     $result = parent::_beforeToHtml();
     $quote = Mage::getSingleton('checkout/session')->getQuote();
     // check payment method availability
     $methodInstance = Mage::helper('payment')->getMethodInstance($this->_paymentMethodCode);
     if (!$methodInstance || !$methodInstance->isAvailable($quote)) {
         $this->_shouldRender = false;
         return $result;
     }
     // check payment method type availability
     $configMethod = $methodInstance->getConfigForQuote($quote);
     $methodTypes = $configMethod->getTypes();
     if (!in_array($this->_paymentMethodType, $methodTypes)) {
         $this->_shouldRender = false;
         return $result;
     }
     // check visibility button on shopping cart
     $shortcutOnShoppingCart = $this->getHelperConfig()->getConfigGeneral($quote->getStoreId())->getPaymentPaypalExpressCheckout()->getPaypalExpressCheckoutVisibleOnCart();
     if (empty($shortcutOnShoppingCart)) {
         $this->_shouldRender = false;
         return $result;
     }
     // check if we are in a secure environment
     $isSecure = Mage::app()->getStore()->isCurrentlySecure();
     // set misc data
     $this->setShortcutHtmlId($this->helper('core')->uniqHash('ppe_shortcut_'))->setCheckoutUrl($this->getUrl($this->_startAction, array('_secure' => $isSecure)));
     $this->setImageUrl(Mage::getModel('payone_core/service_paypal_express_checkout', array('quote' => $quote, 'config' => $configMethod))->getCheckoutShortcutImageUrl());
     return $result;
 }
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $banner = $this->getBannerObj();
     if ($banner->getData('type_id') == Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_ROTATOR) {
         $randBanner = Mage::getSingleton('affiliateplusbanner/rotator')->getRandomBanner($banner->getData('banner_id'), $banner->getStoreId());
         if ($banner->getData('width')) {
             $randBanner->setData('width', $banner->getData('width'));
         }
         if ($banner->getData('height')) {
             $randBanner->setData('height', $banner->getData('height'));
         }
         $randBanner->setData('banner_id', $banner->getData('banner_id'))->setData('status', $banner->getData('status'))->setData('link', $banner->getData('link'))->setData('program_id', $banner->getData('program_id'))->setData('target', $banner->getData('target'))->setData('rel_nofollow', $banner->getData('rel_nofollow'));
         $this->setBannerObj($randBanner);
     }
     switch ($this->getBannerObj()->getData('type_id')) {
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_FLASH:
             $this->setTemplate('affiliateplusbanner/flash.phtml');
             break;
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_IMAGE:
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_HOVER:
             $this->setTemplate('affiliateplusbanner/image.phtml');
             break;
         case Magestore_AffiliateplusBanner_Helper_Data::BANNER_TYPE_PEEL:
             $this->setTemplate('affiliateplusbanner/peel.phtml');
             break;
         default:
             $this->setTemplate('affiliateplusbanner/blank.phtml');
     }
     if (!$this->getBannerObj()->getData('source_file')) {
         $this->setTemplate('affiliateplusbanner/blank.phtml');
     }
     return $this;
 }
예제 #9
0
 /**
  * Initialize data and prepare it for output
  */
 protected function _beforeToHtml()
 {
     $this->_prepareLastOrder();
     $this->_prepareLastBillingAgreement();
     $this->_prepareLastRecurringProfiles();
     return parent::_beforeToHtml();
 }
 protected function _beforeToHtml()
 {
     if (!$this->getProductId()) {
         return false;
     }
     return parent::_beforeToHtml();
 }
예제 #11
0
 /**
  * Setup the comments block
  *
  */
 protected function _beforeToHtml()
 {
     if ($commentsBlock = $this->getCommentsBlock()) {
         $commentsBlock->setPost($this->getPost());
     }
     return parent::_beforeToHtml();
 }
예제 #12
0
 protected function _beforeToHtml()
 {
     $toolbar = $this->getToolbarBlock();
     // called prepare sortable parameters
     $collection = $this->getLoadedProductCollection();
     // use sortable parameters
     if ($orders = $this->getAvailableOrders()) {
         $toolbar->setAvailableOrders($orders);
     }
     if ($sort = $this->getSortBy()) {
         $toolbar->setDefaultOrder($sort);
     }
     if ($dir = $this->getDefaultDirection()) {
         $toolbar->setDefaultDirection($dir);
     }
     if ($modes = $this->getModes()) {
         $toolbar->setModes($modes);
     }
     // set collection to toolbar and apply sort
     $toolbar->setCollection($collection);
     $this->setChild('toolbar', $toolbar);
     Mage::dispatchEvent('catalog_block_product_list_collection', array('collection' => $this->getLoadedProductCollection()));
     $this->getLoadedProductCollection()->load();
     return parent::_beforeToHtml();
 }
예제 #13
0
 protected function _beforeToHtml()
 {
     $testimonials = $this->_getTestimonialsCollection();
     $this->setTestimonials($testimonials);
     $this->_placeholderImage = Mage::helper('testimonials')->getPlaceholderImage();
     return parent::_beforeToHtml();
 }
예제 #14
0
 protected function _beforeToHtml()
 {
     $this->_language = Mage::getStoreConfig("sag_settings/{$this->_configNode}/language");
     $this->_size = Mage::getStoreConfig("sag_settings/{$this->_configNode}/size");
     $this->_color = Mage::getStoreConfig("sag_settings/{$this->_configNode}/color");
     return parent::_beforeToHtml();
 }
예제 #15
0
 protected function _beforeToHtml()
 {
     if (!Mage::helper('magenotification')->checkLicenseKey('Sociallogin')) {
         $this->setTemplate(null);
     }
     return parent::_beforeToHtml();
 }
예제 #16
0
 /**
  * If post view, setup the post with child blocks
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     if ($this->getPost() && $this->_getBlockForPostPrepare() !== false) {
         $this->preparePost($this->getPost());
     }
     return parent::_beforeToHtml();
 }
예제 #17
0
 /**
  * If a template isn't passed in the XML, set the default template
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     if (!$this->getTemplate()) {
         $this->setTemplate('apptha_banners/default.phtml');
     }
     return $this;
 }
 public function _beforeToHtml()
 {
     if ($this->hasData('method_code')) {
         return parent::_beforeToHtml();
     } else {
         return false;
     }
 }
예제 #19
0
 protected function _beforeToHtml()
 {
     $toolbar = $this->getToolbar();
     // called prepare sortable parameters
     $collection = $this->getPosts();
     // set collection to toolbar and apply sort
     $toolbar->setCollection($collection);
     return parent::_beforeToHtml();
 }
예제 #20
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     if ($toolbar = $this->getLayout()->getBlock('udratings_list.toolbar')) {
         $toolbar->setCollection($this->getReviewsCollection());
         $this->setChild('toolbar', $toolbar);
     }
     return $this;
 }
 /**
  * Set active category if any.
  *
  * return Zeon_Faq_Block_Category
  */
 protected function _beforeToHtml()
 {
     $categoryId = $this->getRequest()->getParam('category', null);
     $model = Mage::getModel('zeon_faq/category');
     if ($categoryId) {
         $category = $model->load($categoryId);
         $this->setCurrentCategory($category);
     }
     return parent::_beforeToHtml();
 }
예제 #22
0
 /**
  * Load the badge-generator.js script at before_body_end
  */
 public function _beforeToHtml()
 {
     if (!$this->getLayout()->getBlock('badges_script')) {
         //if this is the first element
         $script = $this->getLayout()->createBlock('donations/cms_badges_script', 'badges_script');
         //$script->setMethod('toHtml');
         $this->getLayout()->getBlock('before_body_end')->append($script);
     }
     parent::_beforeToHtml();
 }
예제 #23
0
 /**
  * Initialize self totals and children blocks totals before html building
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _beforeToHtml()
 {
     $this->_initTotals();
     foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $child) {
         if (method_exists($child, 'initTotals')) {
             $child->initTotals();
         }
     }
     return parent::_beforeToHtml();
 }
예제 #24
0
 protected function _beforeToHtml()
 {
     if ($this->getLayout()->getBlock('testimonials.list.content')) {
         $testimonials = $this->getLayout()->getBlock('testimonials.list.content')->getTestimonials();
     } else {
         $testimonials = Mage::getModel('tm_testimonials/data')->getCollection()->addFieldToSelect('*')->addStoreFilter(Mage::app()->getStore())->addFieldToFilter('status', TM_Testimonials_Model_Data::STATUS_ENABLED)->setOrder('date', 'desc')->setPageSize($this->getPerPage())->setCurPage($this->getCurrentPage());
     }
     $this->setTestimonials($testimonials);
     return parent::_beforeToHtml();
 }
예제 #25
0
 protected function _beforeToHtml()
 {
     $result = parent::_beforeToHtml();
     $params = array($this->_paymentMethodCode);
     $config = Mage::getModel('Mage_Paypal_Model_Config', array('params' => $params));
     $isInCatalog = $this->getIsInCatalogProduct();
     $quote = $isInCatalog || '' == $this->getIsQuoteAllowed() ? null : Mage::getSingleton('Mage_Checkout_Model_Session')->getQuote();
     // check visibility on cart or product page
     $context = $isInCatalog ? 'visible_on_product' : 'visible_on_cart';
     if (!$config->{$context}) {
         $this->_shouldRender = false;
         return $result;
     }
     if ($isInCatalog) {
         // Show PayPal shortcut on a product view page only if product has nonzero price
         /** @var $currentProduct Mage_Catalog_Model_Product */
         $currentProduct = Mage::registry('current_product');
         if (!is_null($currentProduct)) {
             $productPrice = (double) $currentProduct->getFinalPrice();
             if (empty($productPrice) && !$currentProduct->isGrouped()) {
                 $this->_shouldRender = false;
                 return $result;
             }
         }
     }
     // validate minimum quote amount and validate quote for zero grandtotal
     if (null !== $quote && (!$quote->validateMinimumAmount() || !$quote->getGrandTotal() && !$quote->hasNominalItems())) {
         $this->_shouldRender = false;
         return $result;
     }
     // check payment method availability
     $methodInstance = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance($this->_paymentMethodCode);
     if (!$methodInstance || !$methodInstance->isAvailable($quote)) {
         $this->_shouldRender = false;
         return $result;
     }
     // set misc data
     $this->setShortcutHtmlId($this->helper('Mage_Core_Helper_Data')->uniqHash('ec_shortcut_'))->setCheckoutUrl($this->getUrl($this->_startAction));
     // use static image if in catalog
     if ($isInCatalog || null === $quote) {
         $this->setImageUrl($config->getExpressCheckoutShortcutImageUrl(Mage::app()->getLocale()->getLocaleCode()));
     } else {
         $parameters = array('params' => array('quote' => $quote, 'config' => $config));
         $checkoutModel = Mage::getModel($this->_checkoutType, $parameters);
         $this->setImageUrl($checkoutModel->getCheckoutShortcutImageUrl());
     }
     // ask whether to create a billing agreement
     $customerId = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerId();
     // potential issue for caching
     if (Mage::helper('Mage_Paypal_Helper_Data')->shouldAskToCreateBillingAgreement($config, $customerId)) {
         $this->setConfirmationUrl($this->getUrl($this->_startAction, array(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => 1)));
         $this->setConfirmationMessage(Mage::helper('Mage_Paypal_Helper_Data')->__('Would you like to sign a billing agreement to streamline further purchases with PayPal?'));
     }
     return $result;
 }
예제 #26
0
 /**
  * @return Mage_Core_Block_Abstract
  */
 protected function _beforeToHtml()
 {
     $result = parent::_beforeToHtml();
     $quote = $this->getQuote();
     // validate minimum quote amount and validate quote for zero grandtotal
     if (null !== $quote && (!$quote->validateMinimumAmount() || !$quote->getGrandTotal() && !$quote->hasNominalItems())) {
         $this->_shouldRender = false;
         return $result;
     }
     return $result;
 }
예제 #27
0
 protected function _beforeToHtml()
 {
     if (!$this->getTemplate()) {
         if ($this->getData('id') || $this->getData('increment_id')) {
             $this->setTemplate('aw_featured/block.phtml');
         } else {
             $this->setTemplate('aw_featured/blocks.phtml');
         }
     }
     return parent::_beforeToHtml();
 }
예제 #28
0
 /**
  * Checks to see if Reviews are enabled
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _beforeToHtml()
 {
     if (!$this->isReviewsEnabled()) {
         $this->setTemplate('');
         return parent::_beforeToHtml();
     }
     if (!$this->_setReviews()) {
         $this->setTemplate('');
         return parent::_beforeToHtml();
     }
     return parent::_beforeToHtml();
 }
예제 #29
0
 protected function _beforeToHtml()
 {
     $frontend = (string) Mage::getStoreConfig('payment/sagepaypaypal/frontend_behaviour', Mage::app()->getStore()->getId());
     $this->_shouldRender = Mage::getModel('sagepaysuite/api_payment')->isPayPalEnabled() && ($frontend === 'button' or $frontend === 'both');
     $total = $this->helper('checkout/cart')->getQuote()->getGrandTotal();
     $minTotal = Mage::getStoreConfig('payment/sagepaypaypal/min_order_total');
     $maxTotal = Mage::getStoreConfig('payment/sagepaypaypal/max_order_total');
     if (!empty($minTotal) && $total < $minTotal || !empty($maxTotal) && $total > $maxTotal) {
         $this->_shouldRender = false;
     }
     return parent::_beforeToHtml();
 }
예제 #30
0
파일: Widget.php 프로젝트: Emagedev/Yanws
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $collection = Mage::getModel('yanws/news')->getCollection()->setOrder('timestamp_created', 'desc');
     $last = $collection->addFieldToFilter('is_published', array('eq' => 1))->setPageSize(3)->setCurPage(1);
     $title = Mage::getStoreConfig('yanws_section/titles_group/widget_title');
     if ($title === "") {
         $title = $this->__('Got news?');
     }
     $this->setTitle($title);
     $this->setLast($last);
 }