init() public method

???
public init ( )
Example #1
0
 function init()
 {
     parent::init();
     $this->setConfigs();
     $this->addTranslator();
     $this->api->addHook('localizeString', array($this, '_'));
 }
Example #2
0
 function init()
 {
     parent::init();
     if ($_GET['xepan_landing_contact_id'] || $_GET['xepan_landing_campaign_id'] || $_GET['xepan_landing_content_id'] || $_GET['xepan_landing_emailsetting_id']) {
         $this->landingResponse();
     }
 }
Example #3
0
 function init()
 {
     parent::init();
     if ($this->api instanceof \api_Admin) {
         $this->api->routePages('atk4tests');
     }
     $this->addLocation(array('test' => 'collections'));
 }
Example #4
0
 function init()
 {
     parent::init();
     // Route pages of this add-on with following prefix
     //$this->routePages('darkside666_autocomplete');
     // Add add-on locations to pathfinder
     $loc = $this->addLocation(['template' => 'templates', 'public' => 'public', 'js' => 'public/js', 'css' => 'public/css']);
     // hackish and incorrect way to set baseURL of add-on
     $loc->setBaseURL($this->app->url('/') . '../../vendor/' . __NAMESPACE__);
 }
Example #5
0
 function init()
 {
     parent::init();
     if (!$this->app instanceof \App_Admin) {
         retrun;
     }
     $this->app->dam = $this;
     $this->initMenu();
     $this->app->routePages('dam', 'dokku_alt');
 }
Example #6
0
 function init()
 {
     parent::init();
     $this->routePages('xepan_dispatch');
     $this->addLocation(array('template' => 'templates', 'js' => 'templates/js'))->setBaseURL('../vendor/xepan/dispatch/');
     if ($this->app->is_admin) {
         $m = $this->app->top_menu->addMenu('Dispatch');
         $m->addItem('Dispatch', 'xepan_dispatch_dispatchrequest');
         // $this->app->side_menu->addItem('Dispatch','jkj');
     }
 }
Example #7
0
 function init()
 {
     parent::init();
     $this->addLocation(['dbupdates' => 'doc/dbupdates']);
     if (!$this->app instanceof \App_Admin) {
         retrun;
     }
     $this->app->dam = $this;
     $this->initMenu();
     $this->app->routePages('dam', 'dokku_alt');
 }
Example #8
0
 function init()
 {
     parent::init();
     // $this->app->forget($this->app->current_website_name.'_epan');
     $this->addAppDateFunctions();
     if (!($this->app->epan = $this->app->recall($this->app->current_website_name . '_epan', false))) {
         $this->app->epan = $this->add('xepan\\base\\Model_Epan')->tryLoadBy('name', $this->app->current_website_name);
         $this->app->memorize($this->app->current_website_name . '_epan', $this->app->epan);
     }
     if (!$this->app->epan->loaded()) {
         $this->app->forget($this->app->current_website_name . '_epan');
         die('No site found, forwarding to 404 service');
     }
     $path = $this->path = $this->api->pathfinder->base_location->base_path . '/vendor/xepan/epanservices/dbversion';
     $db_model = $this->add('xepan/epanservices/Model_DbVersion', array('dir' => 'dbversion', 'namespace' => 'xepan\\epanservices'));
     if ($this->app->epan['epan_dbversion'] < (int) $db_model->max_count) {
         $this->app->epan->reload();
         $this->app->memorize($this->app->current_website_name . '_epan', $this->app->epan);
         foreach ($db_model as $file) {
             if (!file_exists($path . "/" . $file['name'])) {
                 continue;
             }
             $file_name = explode('.', $file['name']);
             if (isset($file_name[0]) && (int) $file_name[0] > $this->app->epan['epan_dbversion']) {
                 try {
                     $sql = file_get_contents($path . "/" . $file['name']);
                     if ($file_name[1] == 'sql') {
                         $this->app->db->dsql()->expr('SET FOREIGN_KEY_CHECKS = 0;')->execute();
                         $this->app->db->dsql()->expr('SET unique_checks=0;')->execute();
                         $this->api->db->beginTransaction();
                         $this->app->db->dsql()->expr($sql)->execute();
                         $this->app->epan['epan_dbversion'] = (int) $file_name[0];
                         $this->app->epan->save();
                         $this->app->memorize($this->app->current_website_name . '_epan', $this->app->epan);
                         $this->api->db->commit();
                     } elseif ($file_name[1] == 'php') {
                         include_once $file['name'];
                     }
                 } catch (\Exception_StopInit $e) {
                 } catch (\Exception $e) {
                     if ($file_name[1] == 'sql') {
                         $this->app->db->dsql()->expr('SET FOREIGN_KEY_CHECKS = 1;')->execute();
                         $this->app->db->dsql()->expr('SET unique_checks=1;')->execute();
                         $this->api->db->rollback();
                     }
                     throw $e;
                 }
             }
         }
     }
     $this->app->epan->config = $this->app->epan->ref('Configurations');
     $misc_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['time_zone' => 'DropDown'], 'config_key' => 'Miscellaneous_Technical_Settings', 'application' => 'base']);
     $misc_m->tryLoadAny();
     date_default_timezone_set($misc_m['time_zone'] ?: 'UTC');
     $this->app->today = date('Y-m-d');
     $this->app->now = date('Y-m-d H:i:s');
     //Todo load default location of a customer from browser or
     $this->app->country = $this->app->recall('xepan-customer-current-country');
     $this->app->state = $this->app->recall('xepan-customer-current-state');
     $event_cont = $this->add('xepan\\base\\Controller_PointEventManager');
     $this->app->addHook('pointable_event', [$event_cont, 'handleEvent']);
     $this->app->addHook('widget_collection', [$this, 'exportWidgets']);
     $this->app->addHook('entity_collection', [$this, 'exportEntities']);
 }
Example #9
0
 function init()
 {
     parent::init();
     $this->addAppRoundAmount();
     define('K_PATH_FONTS', getcwd() . '/vendor/xepan/commerce/templates/fonts/');
 }
Example #10
0
 function init()
 {
     parent::init();
 }