public static function error($error, $code) { $null = null; $callback = Artx_Data_Mappers::errorCallback($null, true); if (isset($callback)) { call_user_func($callback, $error, $code); } return $error; }
private function _configureEditor() { $extensions = Artx_Data_Mappers::get('extension'); $tinyMce = $extensions->findOne(array('element' => 'tinymce')); if (is_string($tinyMce)) { return $this->_error($tinyMce, 1); } if (!is_null($tinyMce)) { $params = $this->_stringToParams($tinyMce->params); $elements = strlen($params['extended_elements']) ? explode(',', $params['extended_elements']) : array(); $invalidElements = strlen($params['invalid_elements']) ? explode(',', $params['invalid_elements']) : array(); if (in_array('script', $invalidElements)) { array_splice($invalidElements, array_search('script', $invalidElements), 1); } if (!in_array('style', $elements)) { $elements[] = 'style'; } if (!in_array('script', $elements)) { $elements[] = 'script'; } if (!in_array('div[*]', $elements)) { $elements[] = 'div[*]'; } $params['extended_elements'] = implode(',', $elements); $params['invalid_elements'] = implode(',', $invalidElements); $tinyMce->params = $this->_paramsToString($params); $status = $extensions->save($tinyMce); if (is_string($status)) { return $this->_error($status, 1); } } return null; }
protected function _error($error, $code) { Artx_Data_Mappers::error($error, $code); }