Exemple #1
0
 /**
  * Returns an HTML formatted attribute string
  * @param    array   $attributes
  * @return   string
  * @access   private
  */
 function _getAttrString($attributes)
 {
     $strAttr = '';
     if (is_array($attributes)) {
         $charset = HTML_Common::charset();
         foreach ($attributes as $key => $value) {
             $strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
         }
     }
     return $strAttr;
 }
Exemple #2
0
 /**
  * Returns the value of field without HTML tags (in this case, value is changed to a mask)
  *
  * @since     1.0
  * @access    public
  * @return    string
  */
 public function getFrozenHtml()
 {
     // Modified by Ivan Tcholakov, 16-MAR-2010.
     //$value = htmlspecialchars($this->getValue());
     $value = @htmlspecialchars($this->getValue(), ENT_COMPAT, HTML_Common::charset());
     //
     if ($this->getAttribute('wrap') == 'off') {
         $html = $this->_getTabs() . '<pre>' . $value . "</pre>\n";
     } else {
         $html = nl2br($value) . "\n";
     }
     return $html . $this->_getPersistantData();
 }
Exemple #3
0
 /**
  * Called when visiting a header element
  *
  * @param    object     An HTML_QuickForm_header element being visited
  * @access   public
  * @return   void
  */
 function renderHeader(&$header)
 {
     $name = $header->getName();
     $id = empty($name) ? '' : ' id="' . $name . '"';
     if (!empty($name) && isset($this->_templates[$name])) {
         $header_html = str_replace('{header}', $header->toHtml(), $this->_templates[$name]);
     } else {
         $header_html = str_replace('{header}', $header->toHtml(), $this->_headerTemplate);
     }
     $attributes = $header->getAttributes();
     $strAttr = '';
     if (is_array($attributes)) {
         $charset = HTML_Common::charset();
         foreach ($attributes as $key => $value) {
             if ($key == 'name') {
                 continue;
             }
             $strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
         }
     }
     if ($this->_fieldsetsOpen > 0) {
         $this->_html .= $this->_closeFieldsetTemplate;
         $this->_fieldsetsOpen--;
     }
     $openFieldsetTemplate = str_replace('{id}', $id, $this->_openFieldsetTemplate);
     $openFieldsetTemplate = str_replace('{attributes}', $strAttr, $openFieldsetTemplate);
     $this->_html .= $openFieldsetTemplate . $header_html;
     $this->_fieldsetsOpen++;
 }
Exemple #4
0
 /**
  * Returns the value of field without HTML tags
  *
  * @since     1.0
  * @access    public
  * @return    string
  */
 function getFrozenHtml()
 {
     $value = $this->getValue();
     // Modified by Ivan Tcholakov, 16-MAR-2010.
     //return ('' != $value? htmlspecialchars($value): '&nbsp;') .
     //       $this->_getPersistantData();
     $value = ('' != $value ? @htmlspecialchars($value, ENT_COMPAT, HTML_Common::charset()) : '&nbsp;') . $this->_getPersistantData();
     return '<span class="freeze">' . $value . '</span>';
     //
 }
 /**
  * Returns an HTML formatted attribute string
  * Use Sigma for parsing
  * @param    array   $attributes
  * @return   string
  * @access   private
  */
 function _getAttrString($attributes)
 {
     $template = new \Cx\Core\Html\Sigma(ASCMS_CORE_PATH . '/Html/View/Template/Generic/');
     $template->loadTemplateFile('Attribute.html');
     $strAttr = '';
     if (is_array($attributes)) {
         $charset = HTML_Common::charset();
         foreach ($attributes as $key => $value) {
             $template->setVariable(array('ATTRIBUTE_NAME' => $key, 'ATTRIBUTE_VALUE' => htmlspecialchars($value, ENT_COMPAT, $charset)));
             $template->parse('attribute');
         }
     }
     return $template->get();
 }
Exemple #6
0
 /**
  * Returns an HTML formatted attribute string
  * @param    array   $attributes
  * @return   string
  * @access   private
  */
 function _getAttrString($attributes)
 {
     $strAttr = '';
     if (is_array($attributes)) {
         $charset = HTML_Common::charset();
         foreach ($attributes as $key => $value) {
             // Modified by Ivan Tcholakov, 16-MAR-2010
             //$strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
             $strAttr .= ' ' . $key . '="' . @htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
             //
         }
     }
     return $strAttr;
 }