예제 #1
0
 /**
  * @param array|string $synonyms
  * @param Extension $extension
  */
 public function addExtension($synonyms, Extension $extension)
 {
     if (!is_array($synonyms)) {
         $synonyms = array($synonyms);
     }
     foreach ($synonyms as $synonym) {
         $extension->init($this);
         $this->extensions[$synonym] = $extension;
     }
 }
 public function init()
 {
     parent::init();
     if ($message = Session::get('Status')) {
         $this->owner->StatusMessage = DBField::create_field('HTMLText', $message['message']);
         $this->owner->StatusType = isset($message['type']) ? $message['type'] : 'success';
         Session::clear('Status');
     } else {
         $messages = Session::get_all();
         if ($messages && isset($messages['FormInfo'])) {
             foreach ($messages['FormInfo'] as $name => $message) {
                 if (isset($message['formError'])) {
                     $this->owner->StatusMessage = DBField::create_field('HTMLText', $message['formError']['message']);
                     $this->owner->StatusType = isset($message['formError']['type']) ? $message['formError']['type'] : 'success';
                 }
             }
             Session::clear('FormInfo');
         }
     }
     if ($this->owner->StatusMessage) {
         $this->owner->StatusMessage = html_entity_decode($this->owner->StatusMessage);
     }
 }
예제 #3
0
 protected function __construct()
 {
     self::$Configuration = new Configuration();
     DateTimeObj::setDefaultTimezone(self::Configuration()->core()->region->timezone);
     self::$_lang = self::Configuration()->core()->symphony->lang ? self::Configuration()->core()->symphony->lang : 'en';
     define_safe('__SYM_DATE_FORMAT__', self::Configuration()->core()->region->{'date-format'});
     define_safe('__SYM_TIME_FORMAT__', self::Configuration()->core()->region->{'time-format'});
     define_safe('__SYM_DATETIME_FORMAT__', sprintf('%s %s', __SYM_DATE_FORMAT__, __SYM_TIME_FORMAT__));
     define_safe('ADMIN_URL', sprintf('%s/%s', URL, trim(self::Configuration()->core()->symphony->{'administration-path'}, '/')));
     $this->initialiseLog();
     GenericExceptionHandler::initialise();
     GenericErrorHandler::initialise(self::$Log);
     $this->initialiseCookie();
     $this->initialiseDatabase();
     Extension::init();
     Cache::setDriver(self::Configuration()->core()->{'cache-driver'});
     Lang::loadAll(true);
 }