/** * 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; }
/** * Writes the block data into persistence (destroys previous and insert new) * * @param integer $pageID The page which contains the client space, DB ID * @param integer $clientSpaceID The client space which contains the row, DB ID * @param integer $rowID The row which contains the block, DB ID * @param integer $location The location we want to completly remove the block from * @param boolean $public The precision needed for USERSPACE location * @param array(mixed=>mixed) $data The data indexed by data type (value, file, alt_tag, ...), * @return boolean true on success, false on failure * @access public */ function writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data) { parent::writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data); //delete the old data $this->delFromLocation($pageID, $clientSpaceID, $rowID, $location, $public); $table = $this->_getDataTableName($location, $public); $sql = "\n\t\t\tinsert into\n\t\t\t\t" . $table . "\n\t\t\tset\n\t\t\t\tpage='" . $pageID . "',\n\t\t\t\tclientSpaceID='" . $clientSpaceID . "',\n\t\t\t\trowID='" . $rowID . "',\n\t\t\t\tblockID='" . $this->_tagID . "',\n\t\t\t\tvalue='" . SensitiveIO::sanitizeSQLString($data["value"]) . "'\n\t\t"; $q = new CMS_query($sql); if ($q->hasError()) { return false; } else { return true; } }