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


PHP sensitiveIO::decodeEntities方法代码示例

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


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

示例1: getHTMLAdmin

    /**
     * get HTML admin (used to enter object values in admin)
     *
     * @param integer $fieldID, the current field id (only for poly object compatibility)
     * @param CMS_language $language, the current admin language
     * @param string prefixname : the prefix to use for post names
     * @return string : the html admin
     * @access public
     */
    function getHTMLAdmin($fieldID, $language, $prefixName)
    {
        //get module codename
        $moduleCodename = CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID());
        //is this field mandatory ?
        $mandatory = $this->_field->getValue('required') ? '<span class="atm-red">*</span> ' : '';
        $desc = $this->getFieldDescription($language);
        if (POLYMOD_DEBUG) {
            $values = array();
            foreach (array_keys($this->_subfieldValues) as $subFieldID) {
                if (is_object($this->_subfieldValues[$subFieldID])) {
                    $values[$subFieldID] = sensitiveIO::ellipsis(strip_tags($this->_subfieldValues[$subFieldID]->getValue()), 50);
                }
            }
            $desc .= $desc ? '<br />' : '';
            $desc .= '<span class="atm-red">Field : ' . $fieldID . ' - Value(s) : <ul>';
            foreach ($values as $subFieldID => $value) {
                $desc .= '<li>' . $subFieldID . '&nbsp;:&nbsp;' . $value . '</li>';
            }
            $desc .= '</ul></span>';
        }
        $label = $desc ? '<span class="atm-help" ext:qtip="' . io::htmlspecialchars($desc) . '">' . $mandatory . $this->getFieldLabel($language) . '</span>' : $mandatory . $this->getFieldLabel($language);
        $ids = 'oembed-' . md5(mt_rand() . microtime());
        $oembedURL = PATH_ADMIN_MODULES_WR . '/' . MOD_POLYMOD_CODENAME . '/oembed.php';
        $loadingURL = PATH_ADMIN_IMAGES_WR . '/loading-old.gif';
        $params = $this->getParamsValues();
        $fields = array();
        $fields[] = array('fieldLabel' => '<span class="atm-help" ext:qtip="' . io::htmlspecialchars($language->getMessage(self::MESSAGE_OBJECT_OEMBED_MEDIA_URL_DESC, false, MOD_POLYMOD_CODENAME)) . '">' . $language->getMessage(self::MESSAGE_OBJECT_OEMBED_MEDIA_URL, false, MOD_POLYMOD_CODENAME) . '</span>', 'xtype' => 'textfield', 'name' => 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_0]', 'value' => $this->_subfieldValues[0]->getValue() ? sensitiveIO::decodeEntities($this->_subfieldValues[0]->getValue()) : '', 'enableKeyEvents' => true, 'listeners' => array('blur' => array('fn' => sensitiveIO::sanitizeJSString('function(el){
						/*call server for oembed HTML content*/
						Ext.get(\'' . $ids . '-view\').update(\'<img src="' . $loadingURL . '" />\');
						Automne.server.call({
							url:			\'' . $oembedURL . '\',
							scope:			this,
							fcnCallback:	function(response, options, htmlResponse){
								Ext.get(\'' . $ids . '-view\').update(htmlResponse);
							},
							params:			{
								module:			\'' . $moduleCodename . '\',
								url:			el.getValue(),
								width:			600,
								height:			250,
								key:			\'' . $params['embedlyKey'] . '\'
							}
						});
					}', false, false), 'buffer' => 600)));
        $fields[] = array('xtype' => 'panel', 'border' => false, 'html' => '<div id="' . $ids . '-view" style="overflow:auto;text-align:center;">' . ($this->getValue('hasValue') ? $this->getValue('html', '600,250') : '') . '</div>');
        $return = array();
        $return = array('title' => $label, 'xtype' => 'fieldset', 'autoHeight' => true, 'defaultType' => 'textfield', 'defaults' => array('anchor' => '97%', 'allowBlank' => !$this->_field->getValue('required')), 'items' => $fields);
        return $return;
    }
开发者ID:davidmottet,项目名称:automne,代码行数:59,代码来源:object_oembed.php

示例2: setValues

 /**
  * set object Values
  *
  * @param array $values : the POST result values
  * @param string $prefixname : the prefix used for post names
  * @param boolean newFormat : new automne v4 format (default false for compatibility)
  * @param integer $objectID : the current object id. Must be set, but default is blank for compatibility with other objects
  * @return boolean true on success, false on failure
  * @access public
  */
 function setValues($values, $prefixName, $newFormat = false, $objectID = '')
 {
     if (!sensitiveIO::isPositiveInteger($objectID)) {
         $this->raiseError('ObjectID must be a positive integer : ' . $objectID);
         return false;
     }
     //get module codename
     $moduleCodename = CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID());
     //create a sub prefix for CMS_dialog_href object
     $subPrefixName = 'href' . $prefixName . $this->_field->getID() . '_0';
     //create object CMS_href & CMS_dialog_href
     $hrefDialog = new CMS_dialog_href(new CMS_href($this->_subfieldValues[0]->getValue()), $subPrefixName);
     if ($newFormat) {
         $hrefDialog->create($values[$subPrefixName], $moduleCodename, $objectID, $this->_field->getID());
         if ($hrefDialog->hasError()) {
             return false;
         }
         $href = $hrefDialog->getHREF();
         if (!$this->_subfieldValues[0]->setValue($href->getTextDefinition())) {
             return false;
         }
         $content = array('datas' => array('polymodFieldsValue[' . $subPrefixName . ']' => sensitiveIO::decodeEntities($this->_subfieldValues[0]->getValue())));
         $view = CMS_view::getInstance();
         $view->addContent($content);
     } else {
         //check for http://
         if ($values[$subPrefixName . 'link_external'] && io::strpos($values[$subPrefixName . 'link_external'], 'http://') !== 0) {
             $values[$subPrefixName . 'link_external'] = 'http://' . $values[$subPrefixName . 'link_external'];
         }
         $hrefDialog->doPost($moduleCodename, $objectID, $this->_field->getID());
         if ($hrefDialog->hasError()) {
             return false;
         }
         $href = $hrefDialog->getHREF();
         if (!$this->_subfieldValues[0]->setValue($href->getTextDefinition())) {
             return false;
         }
     }
     return true;
 }
开发者ID:davidmottet,项目名称:automne,代码行数:50,代码来源:object_href.php

示例3: getHTMLAdmin

 /**
  * get HTML admin (used to enter object values in admin)
  *
  * @param integer $fieldID, the current field id (only for poly object compatibility)
  * @param CMS_language $language, the current admin language
  * @param string prefixname : the prefix to use for post names
  * @return string : the html admin
  * @access public
  */
 function getHTMLAdmin($fieldID, $language, $prefixName)
 {
     //is this field mandatory ?
     $mandatory = $this->_field->getValue('required') ? '<span class="atm-red">*</span> ' : '';
     $desc = $this->getFieldDescription($language);
     if (POLYMOD_DEBUG) {
         $values = array();
         foreach (array_keys($this->_subfieldValues) as $subFieldID) {
             if (is_object($this->_subfieldValues[$subFieldID])) {
                 $values[$subFieldID] = sensitiveIO::ellipsis(strip_tags($this->_subfieldValues[$subFieldID]->getValue()), 50);
             }
         }
         $desc .= $desc ? '<br />' : '';
         $desc .= '<span class="atm-red">Field : ' . $fieldID . ' - Value(s) : <ul>';
         foreach ($values as $subFieldID => $value) {
             $desc .= '<li>' . $subFieldID . '&nbsp;:&nbsp;' . $value . '</li>';
         }
         $desc .= '</ul></span>';
     }
     $label = $desc ? '<span class="atm-help" ext:qtip="' . io::htmlspecialchars($desc) . '">' . $mandatory . $this->getFieldLabel($language) . '</span>' : $mandatory . $this->getFieldLabel($language);
     $return = array();
     if (sizeof($this->_subfields) === 1) {
         $return = array('allowBlank' => !$this->_field->getValue('required'), 'fieldLabel' => $label, 'xtype' => 'textfield', 'name' => 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_0]', 'value' => $this->_subfieldValues[0]->getValue() ? sensitiveIO::decodeEntities($this->_subfieldValues[0]->getValue()) : '');
     } else {
         $fields = array();
         foreach ($this->_subfields as $subFieldID => $subFieldDefinition) {
             if (is_object($this->_subfieldValues[$subFieldID])) {
                 $fields[] = array('hideLabel' => true, 'xtype' => 'textfield', 'name' => 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_' . $subFieldID . ']', 'value' => $this->_subfieldValues[$subFieldID]->getValue() ? sensitiveIO::decodeEntities($this->_subfieldValues[$subFieldID]->getValue()) : '');
             }
         }
         $return = array('title' => $label, 'xtype' => 'fieldset', 'autoHeight' => true, 'defaultType' => 'textfield', 'defaults' => array('anchor' => '97%', 'allowBlank' => !$this->_field->getValue('required')), 'items' => $fields);
     }
     return $return;
 }
开发者ID:davidmottet,项目名称:automne,代码行数:43,代码来源:object_common.php

示例4: getHTMLAdmin

 /**
  * get HTML admin (used to enter object values in admin)
  *
  * @param integer $fieldID, the current field id (only for poly object compatibility)
  * @param CMS_language $language, the current admin language
  * @param string prefixname : the prefix to use for post names
  * @return string : the html admin
  * @access public
  */
 function getHTMLAdmin($fieldID, $language, $prefixName)
 {
     $return = parent::getHTMLAdmin($fieldID, $language, $prefixName);
     $params = $this->getParamsValues();
     if ($params['html']) {
         global $cms_user;
         // Insert prefered text editor for textarea field
         $module = CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID());
         $toolbarset = !$params['toolbar'] ? $module : $params['toolbar'];
         //create field value
         $value = $this->_subfieldValues[0]->getValue();
         if (class_exists('CMS_wysiwyg_toolbar')) {
             $toolbar = CMS_wysiwyg_toolbar::getByCode($toolbarset, $cms_user);
             $value = $toolbar->hasModulePlugins() ? CMS_textEditor::parseInnerContent($value, $module) : $value;
         }
         $return['xtype'] = 'ckeditor';
         $return['id'] = 'ckeditor' . md5(mt_rand() . microtime());
         $return['value'] = (string) $value;
         $return['editor'] = array('scayt_sLang' => $language->getCode(), 'language' => $language->getCode(), 'customConfig' => PATH_MAIN_WR . '/ckeditor/config.php', 'atmToolbar' => $toolbarset);
     } else {
         $return['xtype'] = 'textarea';
         $return['value'] = str_replace('<br />', "\n", str_replace(array("\n", "\r"), "", sensitiveIO::decodeEntities($return['value'])));
     }
     if (sensitiveIO::isPositiveInteger($params['toolbarHeight'])) {
         $return['height'] = $params['toolbarHeight'];
     }
     if (sensitiveIO::isPositiveInteger($params['toolbarWidth'])) {
         $return['width'] = $params['toolbarWidth'];
     }
     return $return;
 }
开发者ID:davidmottet,项目名称:automne,代码行数:40,代码来源:object_text.php

示例5: setValues


//.........这里部分代码省略.........
                     $newSizeX = $params['maxZoomWidth'];
                 }
                 if ($params['maxZoomHeight'] && $newSizeY > $params['maxZoomHeight']) {
                     $newSizeX = round($params['maxZoomHeight'] * $newSizeX / $newSizeY);
                     $newSizeY = $params['maxZoomHeight'];
                 }
                 if (!$oImage->resize($newSizeX, $newSizeY, $filename)) {
                     return false;
                 }
             }
         }
         //update files infos if needed
         if ($this->_subfieldValues[0]->getValue() && file_exists(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[0]->getValue())) {
             $file = new CMS_file(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[0]->getValue());
             $imageDatas = array('filename' => $file->getName(false), 'filepath' => $file->getFilePath(CMS_file::WEBROOT), 'filesize' => $file->getFileSize(), 'fileicon' => $file->getFileIcon(CMS_file::WEBROOT), 'extension' => $file->getExtension());
         } else {
             $imageDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => '');
         }
         $imageDatas['module'] = $moduleCodename;
         $imageDatas['visualisation'] = RESOURCE_DATA_LOCATION_EDITED;
         if ($params['useDistinctZoom'] || $this->_subfieldValues[2]->getValue()) {
             //update files infos if needed
             if ($this->_subfieldValues[2]->getValue() && file_exists(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[2]->getValue())) {
                 $file = new CMS_file(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[2]->getValue());
                 $zoomDatas = array('filename' => $file->getName(false), 'filepath' => $file->getFilePath(CMS_file::WEBROOT), 'filesize' => $file->getFileSize(), 'fileicon' => $file->getFileIcon(CMS_file::WEBROOT), 'extension' => $file->getExtension());
             } else {
                 $zoomDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => '');
             }
             $zoomDatas['module'] = $moduleCodename;
             $zoomDatas['visualisation'] = RESOURCE_DATA_LOCATION_EDITED;
         } else {
             $zoomDatas = '';
         }
         $content = array('datas' => array('polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_0]' => $imageDatas, 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_2]' => $zoomDatas, 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_1]' => sensitiveIO::decodeEntities($this->_subfieldValues[1]->getValue())));
         $view = CMS_view::getInstance();
         $view->addContent($content);
         return true;
     } else {
         //Old format
         //delete old images ?
         if (isset($values[$prefixName . $this->_field->getID() . '_delete']) && $values[$prefixName . $this->_field->getID() . '_delete'] == 1) {
             if ($this->_subfieldValues[0]->getValue()) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[0]->getValue());
                 $this->_subfieldValues[0]->setValue('');
             } elseif (isset($values[$prefixName . $this->_field->getID() . '_0_hidden']) && $values[$prefixName . $this->_field->getID() . '_0_hidden']) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $values[$prefixName . $this->_field->getID() . '_0_hidden']);
                 $this->_subfieldValues[0]->setValue('');
             }
             if ($this->_subfieldValues[2]->getValue()) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[2]->getValue());
                 $this->_subfieldValues[2]->setValue('');
             } elseif (isset($values[$prefixName . $this->_field->getID() . '_2_hidden']) && $values[$prefixName . $this->_field->getID() . '_2_hidden']) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $values[$prefixName . $this->_field->getID() . '_2_hidden']);
                 $this->_subfieldValues[2]->setValue('');
             }
         }
         //set label from label field
         if (!$this->_subfieldValues[1]->setValue(io::htmlspecialchars(@$values[$prefixName . $this->_field->getID() . '_1']))) {
             return false;
         }
         //thumbnail
         if (isset($_FILES[$prefixName . $this->_field->getID() . '_0']) && $_FILES[$prefixName . $this->_field->getID() . '_0']['name'] && !$_FILES[$prefixName . $this->_field->getID() . '_0']['error']) {
             //check for image type before doing anything
             if (!in_array(io::strtolower(pathinfo($_FILES[$prefixName . $this->_field->getID() . '_0']["name"], PATHINFO_EXTENSION)), $this->_allowedExtensions)) {
                 return false;
             }
开发者ID:davidmottet,项目名称:automne,代码行数:67,代码来源:object_image.php

示例6: setValues


//.........这里部分代码省略.........
                 if ($filesize !== false && $filesize > 0) {
                     //convert in MB
                     $filesize = round($filesize / 1048576, 2);
                 } else {
                     $filesize = '0';
                 }
                 if (!$this->_subfieldValues[2]->setValue($filesize)) {
                     return false;
                 }
             }
         }
         // If label not set yet, set it
         if (!$this->_subfieldValues[0]->getValue()) {
             if ($this->_subfieldValues[4]->getValue()) {
                 $this->_subfieldValues[0]->setValue($this->_subfieldValues[4]->getValue());
             }
         }
         //update files infos if needed
         if ($this->_subfieldValues[1]->getValue() && file_exists(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[1]->getValue())) {
             $file = new CMS_file(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[1]->getValue());
             $imageDatas = array('filename' => $file->getName(false), 'filepath' => $file->getFilePath(CMS_file::WEBROOT), 'filesize' => $file->getFileSize(), 'fileicon' => $file->getFileIcon(CMS_file::WEBROOT), 'extension' => $file->getExtension());
         } else {
             $imageDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => '');
         }
         //update files infos if needed
         if ($this->_subfieldValues[4]->getValue() && file_exists(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[4]->getValue())) {
             $file = new CMS_file(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[4]->getValue());
             $fileDatas = array('filename' => $file->getName(false), 'filepath' => $file->getFilePath(CMS_file::WEBROOT), 'filesize' => $file->getFileSize(), 'fileicon' => $file->getFileIcon(CMS_file::WEBROOT), 'extension' => $file->getExtension());
         } else {
             $fileDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => '');
         }
         $imageDatas['module'] = $fileDatas['module'] = $moduleCodename;
         $imageDatas['visualisation'] = $fileDatas['visualisation'] = RESOURCE_DATA_LOCATION_EDITED;
         $content = array('datas' => array('polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_1]' => $imageDatas, 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_4]' => $fileDatas, 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_externalfile]' => '', 'polymodFieldsValue[' . $prefixName . $this->_field->getID() . '_0]' => sensitiveIO::decodeEntities($this->_subfieldValues[0]->getValue())));
         $view = CMS_view::getInstance();
         $view->addContent($content);
         return true;
     } else {
         //Old format
         //delete old files ?
         if (isset($values[$prefixName . $this->_field->getID() . '_delete']) && $values[$prefixName . $this->_field->getID() . '_delete'] == 1) {
             //thumbnail
             if ($this->_subfieldValues[1]->getValue()) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[1]->getValue());
                 $this->_subfieldValues[1]->setValue('');
             } elseif ($values[$prefixName . $this->_field->getID() . '_1_hidden']) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $values[$prefixName . $this->_field->getID() . '_1_hidden']);
                 $this->_subfieldValues[1]->setValue('');
             }
             //file
             if ($this->_subfieldValues[4]->getValue()) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $this->_subfieldValues[4]->getValue());
                 $this->_subfieldValues[4]->setValue('');
             } elseif ($values[$prefixName . $this->_field->getID() . '_4_hidden']) {
                 @unlink(PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/' . RESOURCE_DATA_LOCATION_EDITED . '/' . $values[$prefixName . $this->_field->getID() . '_4_hidden']);
                 $this->_subfieldValues[4]->setValue('');
             }
             //reset filesize
             if (!$this->_subfieldValues[2]->setValue(0)) {
                 return false;
             }
         }
         if (!(isset($values[$prefixName . $this->_field->getID() . '_0']) && $this->_subfieldValues[0]->setValue(io::htmlspecialchars($values[$prefixName . $this->_field->getID() . '_0'])))) {
             return false;
         }
         //thumbnail
开发者ID:davidmottet,项目名称:automne,代码行数:67,代码来源:object_file.php


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