getTemplatePath() . 'editCustomBlockForm.tpl');
$this->journalId = $journalId;
$this->plugin =& $plugin;
$this->addCheck(new FormValidatorPost($this));
$this->addCheck(new FormValidator($this, 'blockContent', 'required', 'plugins.generic.customBlock.contentRequired'));
}
/**
* Initialize form data from current group group.
*/
function initData() {
$journalId = $this->journalId;
$plugin =& $this->plugin;
// add the tiny MCE script
$this->addTinyMCE();
$this->setData('blockContent', $plugin->getSetting($journalId, 'blockContent'));
}
/**
* Add the tinyMCE script for editing sidebar blocks with a WYSIWYG editor
*/
function addTinyMCE() {
$journalId = $this->journalId;
$plugin =& $this->plugin;
$templateMgr =& TemplateManager::getManager();
// Enable TinyMCE with specific params
$additionalHeadData = $templateMgr->get_template_vars('additionalHeadData');
import('classes.file.JournalFileManager');
$publicFileManager = new PublicFileManager();
$tinyMCE_script = '
';
$templateMgr->assign('additionalHeadData', $additionalHeadData."\n".$tinyMCE_script);
}
/**
* Assign form data to user-submitted data.
*/
function readInputData() {
$this->readUserVars(array('blockContent'));
}
/**
* Get the names of localized fields
* @return array
*/
function getLocaleFieldNames() {
return array('blockContent');
}
/**
* Save page into DB
*/
function save() {
$plugin =& $this->plugin;
$journalId = $this->journalId;
$plugin->updateSetting($journalId, 'blockContent', $this->getData('blockContent'));
}
}
?>