コード例 #1
0
 /**
  * Perform global actions after the user_func has been called
  *
  * @return $this
  */
 protected function _beforeObserver()
 {
     if (($headBlock = $this->_getHeadBlock()) !== false) {
         if ($this->getGooglePublisher()) {
             $this->_getHeadBlock()->addItem('link_rel', $this->getGooglePublisher(), 'rel="author"');
         }
     }
     return parent::_beforeObserver();
 }
コード例 #2
0
ファイル: Data.php プロジェクト: shashankkanungo/magento
 /**
  * Automatically load the plugin options
  *
  */
 protected function _construct()
 {
     parent::_construct();
     $data = array();
     foreach ($this->_optionFields as $key) {
         if ($key !== '') {
             $key = '_' . $key;
         }
         $options = Mage::helper('wordpress')->getWpOption('wpseo' . $key);
         if ($options) {
             $options = unserialize($options);
             foreach ($options as $key => $value) {
                 if (strpos($key, '-') !== false) {
                     unset($options[$key]);
                     $options[str_replace('-', '_', $key)] = $value;
                 }
             }
             $data = array_merge($data, $options);
         }
     }
     $this->setData($data);
 }
コード例 #3
0
 /**
  * Given a key that determines which format to load
  * and a data array, merge the 2 to create a valid title
  *
  * @param string $key
  * @return string|false
  */
 protected function _rewriteString($format)
 {
     if (($value = parent::_rewriteString($format)) !== false) {
         $data = $this->getRewriteData();
         if (is_array($data) && isset($data['sep'])) {
             $value = trim($value, $data['sep'] . ' -/\\|,');
         }
     }
     return $value;
 }