function __construct(&$oModule) { parent::__construct($oModule); $this->_aForm['params']['db']['table'] = $this->_oModule->_oDb->getPrefix() . 'entries'; $this->_aForm['form_attrs']['action'] = BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'post/'; $this->_aForm['inputs']['content']['html'] = 2; unset($this->_aForm['inputs']['snippet']); unset($this->_aForm['inputs']['when']); unset($this->_aForm['inputs']['categories']); }
function __construct(&$oModule) { parent::__construct($oModule); $this->_aForm['params']['db']['table'] = $this->_oModule->_oDb->getPrefix() . 'entries'; $this->_aForm['form_attrs']['action'] = BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'admin/'; $this->_aForm['inputs']['author_id']['value'] = 0; $this->_aForm['inputs']['snippet']['checker']['params'][1] = $this->_oModule->_oConfig->getSnippetLength(); $this->_aForm['inputs']['allow_comment_to'] = array('type' => 'hidden', 'name' => 'comment', 'value' => 0, 'db' => array('pass' => 'Int')); $this->_aForm['inputs']['allow_vote_to'] = array('type' => 'hidden', 'name' => 'vote', 'value' => 0, 'db' => array('pass' => 'Int')); }
function BxDolTextData(&$oModule) { $this->_oModule = $oModule; $this->_iOwnerId = BxDolTextData::getAuthorId(); $oCategories = new BxDolCategories(); $oCategories->getTagObjectConfig(); $this->_aForm = array('form_attrs' => array('id' => 'text_data', 'name' => 'text_data', 'action' => bx_html_attribute($_SERVER['PHP_SELF']), 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => '', 'key' => 'id', 'uri' => 'uri', 'uri_title' => 'caption', 'submit_name' => 'post')), 'inputs' => array('author_id' => array('type' => 'hidden', 'name' => 'author_id', 'value' => $this->_iOwnerId, 'db' => array('pass' => 'Int')), 'caption' => array('type' => 'text', 'name' => 'caption', 'caption' => _t("_td_caption"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 64), 'error' => _t('_td_err_incorrect_length')), 'db' => array('pass' => 'Xss')), 'snippet' => array('type' => 'textarea', 'html' => 0, 'name' => 'snippet', 'caption' => _t("_td_snippet"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 200), 'error' => _t('_td_err_incorrect_length')), 'db' => array('pass' => 'Xss')), 'content' => array('type' => 'textarea', 'html' => 2, 'name' => 'content', 'caption' => _t("_td_content"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 65536), 'error' => _t('_td_err_incorrect_length')), 'db' => array('pass' => 'XssHtml')), 'when' => array('type' => 'datetime', 'name' => 'when', 'caption' => _t("_td_date"), 'value' => date('Y-m-d H:i'), 'required' => 1, 'checker' => array('func' => 'DateTime', 'error' => _t('_td_err_empty_value')), 'db' => array('pass' => 'DateTime')), 'tags' => array('type' => 'text', 'name' => 'tags', 'caption' => _t("_td_tags"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 64), 'error' => _t('_td_err_incorrect_length')), 'info' => _t('_sys_tags_note'), 'db' => array('pass' => 'Xss')), 'categories' => $oCategories->getGroupChooser($this->_oModule->_oConfig->getCategoriesSystemName(), $this->_iOwnerId, true), 'allow_comment_to' => array(), 'allow_vote_to' => array(), 'post' => array('type' => 'submit', 'name' => 'post', 'value' => _t("_td_post")))); if (!empty($this->_iOwnerId)) { $oPrivacy = new BxDolPrivacy(); $sModuleUri = $this->_oModule->_oConfig->getUri(); $this->_aForm['inputs']['allow_comment_to'] = $oPrivacy->getGroupChooser($this->_iOwnerId, $sModuleUri, 'comment'); $this->_aForm['inputs']['allow_vote_to'] = $oPrivacy->getGroupChooser($this->_iOwnerId, $sModuleUri, 'vote'); } }
function _actDelete($aIds) { if (!$this->_isDeleteAllowed(true)) { return false; } if (is_int($aIds) || is_string($aIds)) { $aIds = array((int) $aIds); } $bResult = $this->_oDb->deleteEntries($aIds); if ($bResult) { $oTags = new BxDolTags(); $oCategories = new BxDolCategories(); $oSubscription = BxDolSubscription::getInstance(); foreach ($aIds as $iId) { //--- Entry -> Delete for Alerts Engine ---// $oAlert = new BxDolAlerts($this->_oConfig->getAlertsSystemName(), 'delete', $iId, BxDolTextData::getAuthorId()); $oAlert->alert(); //--- Entry -> Delete for Alerts Engine ---// //--- Reparse Global Tags ---// $oTags->reparseObjTags($this->_oConfig->getTagsSystemName(), $iId); //--- Reparse Global Tags ---// //--- Reparse Global Categories ---// $oCategories->reparseObjTags($this->_oConfig->getCategoriesSystemName(), $iId); //--- Reparse Global Categories ---// //--- Remove all subscriptions ---// $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_oConfig->getSubscriptionsSystemName(), 'object_id' => $iId)); //--- Remove all subscriptions ---// } } return $bResult; }