/** * Get the HTML form given the block HTML example data. * * @param CMS_language &$language The language of the administration frontend * @param CMS_page &$page The page which contains the client space * @param CMS_clientSpace &$clientSpace The client space which contains the row * @param CMS_row &$row The row which contains the block * @param integer $blockID The tag ID of the block * @param string $data The data to show as example * @return string The HTML form which can send to the page that will modify the block * @access private */ protected function _getHTMLForm($language, &$page, &$clientSpace, &$row, $blockID, $data) { global $cms_user; $rawDatas = $this->getRawData($page->getID(), $clientSpace->getTagID(), $row->getTagID(), RESOURCE_LOCATION_EDITION, false); $this->_jsBlockClass = 'Automne.blockImage'; $datas = array('page' => isset($rawDatas['page']) ? $rawDatas['page'] : '', 'clientSpaceID' => isset($rawDatas['clientSpaceID']) ? $rawDatas['clientSpaceID'] : '', 'rowID' => isset($rawDatas['rowID']) ? $rawDatas['rowID'] : '', 'blockID' => isset($rawDatas['blockID']) ? $rawDatas['blockID'] : '', 'minwidth' => $this->_minWidth, 'maxwidth' => $this->_maxWidth); $this->_value = $datas; $this->_administrable = false; $html = parent::_getHTMLForm($language, $page, $clientSpace, $row, $blockID, $data); return $html; }
/** * Get the HTML form given the block HTML example data. * * @param CMS_language &$language The language of the administration frontend * @param CMS_page &$page The page which contains the client space * @param CMS_clientSpace &$clientSpace The client space which contains the row * @param CMS_row &$row The row which contains the block * @param integer $blockID The tag ID of the block * @param string $data The data to show as example * @return string The HTML form which can send to the page that will modify the block * @access private */ protected function _getHTMLForm($language, &$page, &$clientSpace, &$row, $blockID, $data) { global $cms_user; $rawDatas = $this->getRawData($page->getID(), $clientSpace->getTagID(), $row->getTagID(), RESOURCE_LOCATION_EDITION, false); $this->_jsBlockClass = 'Automne.blockFlash'; $this->_value = $rawDatas; $this->_administrable = false; $html = parent::_getHTMLForm($language, $page, $clientSpace, $row, $blockID, $data); return $html; }
/** * Get the HTML form given the block HTML example data. * * @param CMS_language &$language The language of the administration frontend * @param CMS_page &$page The page which contains the client space * @param CMS_clientSpace &$clientSpace The client space which contains the row * @param CMS_row &$row The row which contains the block * @param integer $blockID The tag ID of the block * @param string $data The data to show as example * @return string The HTML form which can send to the page that will modify the block * @access private */ protected function _getHTMLForm($language, &$page, &$clientSpace, &$row, $blockID, $data) { global $cms_user; $this->_jsBlockClass = 'Automne.blockCMS_Forms'; $rawDatas = $this->getRawData($page->getID(), $clientSpace->getTagID(), $row->getTagID(), RESOURCE_LOCATION_EDITION, false); $datas = array('page' => isset($rawDatas['page']) ? $rawDatas['page'] : '', 'clientSpaceID' => isset($rawDatas['clientSpaceID']) ? $rawDatas['clientSpaceID'] : '', 'rowID' => isset($rawDatas['rowID']) ? $rawDatas['rowID'] : '', 'blockID' => isset($rawDatas['blockID']) ? $rawDatas['blockID'] : '', 'module' => MOD_CMS_FORMS_CODENAME); $this->_value = $datas; $html = parent::_getHTMLForm($language, $page, $clientSpace, $row, $blockID, '<div class="atm-form-block atm-block-helper">' . $data . '</div>'); //load interface instance $view = CMS_view::getInstance(); //append JS block class file if (PATH_REALROOT_WR) { $file = str_replace(PATH_REALROOT_WR . '/', '', PATH_ADMIN_WR . '/js/edit/block-cms-forms.js'); } else { $file = PATH_ADMIN_WR . '/js/edit/block-cms-forms.js'; } $view->addJSFile($file); return $html; }
/** * Get the HTML form given the block HTML example data. * * @param CMS_language &$language The language of the administration frontend * @param CMS_page &$page The page which contains the client space * @param CMS_clientSpace &$clientSpace The client space which contains the row * @param CMS_row &$row The row which contains the block * @param integer $blockID The tag ID of the block * @param string $data The data to show as example * @return string The HTML form which can send to the page that will modify the block * @access private */ protected function _getHTMLForm($language, &$page, &$clientSpace, &$row, $blockID, $data) { global $cms_user; $rawDatas = $this->getRawData($page->getID(), $clientSpace->getTagID(), $row->getTagID(), RESOURCE_LOCATION_EDITION, false); $this->_jsBlockClass = 'Automne.blockText'; $this->_value = CMS_textEditor::parseInnerContent($rawDatas['value']); $this->_value = base64_encode($this->_value); //set editor options $this->_options = array('styles' => isset($this->_attributes['styles']) ? $this->_attributes['styles'] : '', 'bgcolor' => isset($this->_attributes['bgcolor']) ? $this->_attributes['bgcolor'] : '', 'language' => $language->getCode(), 'atmToolbar' => isset($this->_attributes['toolbar']) ? $this->_attributes['toolbar'] : '', 'utf8' => strtolower(APPLICATION_DEFAULT_ENCODING) == 'utf-8'); $this->_administrable = false; $html = parent::_getHTMLForm($language, $page, $clientSpace, $row, $blockID, $data); //encode brackets to avoid vars ( {something:type:var} ) to be interpretted //decoded into CMS_row::getData $html = preg_replace('#{([a-zA-Z0-9._{}:-]*)}#U', '||bo||\\1||bc||', $html); $replace = array('||bovd||' => '{', '||bcvd||' => '}'); $html = str_replace(array_keys($replace), $replace, $html); return $html; }