/**
  * Creates the markup for an attribute
  *
  * @param string $attribute_name
  * @param string $attribute_value
  * @return string
  */
 protected function create_attribute_markup($attribute_name, $attribute_value)
 {
     if (empty($attribute_value)) {
         return '';
     }
     $attribute_value = $this->template_adapter->escape_attribute($attribute_value);
     return "{$attribute_name}='{$attribute_value}'";
 }
コード例 #2
0
 /**
  * Renders the markup for the attributes of the tag
  *
  * @return string
  */
 protected function render_attributes_markup()
 {
     $html = array();
     foreach ($this->attributes as $name => $values) {
         $values = $this->template_adapter->escape_attribute(implode(' ', $values));
         $html[] = "{$name}='{$values}'";
     }
     return implode(' ', $html);
 }
コード例 #3
0
 /**
  * Create the link that will be added to the frontend
  */
 public function add_link_to_html_for_frontend()
 {
     $preview = '';
     if (true === $this->preview_mode) {
         // bypass browser caching of the css
         $now = strtotime('now');
         $preview = "&preview=1&nocache={$now}&ai1ec_stylesheet=" . $_GET['ai1ec_stylesheet'];
     }
     $url = $this->get_css_url() . $preview;
     $this->template_adapter->enqueue_script('ai1ec_style', $url);
 }