Inheritance: extends AbstractController
Exemplo n.º 1
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();
     }
 }
Exemplo n.º 2
0
 function init()
 {
     parent::init();
     $this->setConfigs();
     $this->addTranslator();
     $this->api->addHook('localizeString', array($this, '_'));
 }
Exemplo n.º 3
0
 function init()
 {
     parent::init();
     if ($this->api instanceof \api_Admin) {
         $this->api->routePages('atk4tests');
     }
     $this->addLocation(array('test' => 'collections'));
 }
Exemplo n.º 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__);
 }
Exemplo n.º 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');
 }
Exemplo n.º 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');
     }
 }
Exemplo n.º 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');
 }
Exemplo n.º 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']);
 }
Exemplo n.º 9
0
 function init()
 {
     parent::init();
     $this->addAppRoundAmount();
     define('K_PATH_FONTS', getcwd() . '/vendor/xepan/commerce/templates/fonts/');
 }
Exemplo n.º 10
0
Arquivo: Admin.php Projeto: atk4/atk4
 /**
  * @todo Description
  *
  * @param Controller_Addon $addon
  */
 private function initAddon($addon)
 {
     $base_path = $this->pathfinder->base_location->getPath();
     $init_class_path = $base_path . '/../' . $addon->get('addon_full_path') . '/lib/Initiator.php';
     if (file_exists($init_class_path)) {
         include $init_class_path;
         $class_name = str_replace('/', '\\', $addon->get('name') . '\\Initiator');
         /** @type Controller_Addon $init */
         $init = $this->add($class_name, array('addon_obj' => $addon, 'base_path' => $base_path));
         if (!is_a($init, 'Controller_Addon')) {
             throw $this->exception('Initiator of ' . $addon->get('name') . ' is inherited not from \\Controller_Addon');
         }
         /*
          * initiators of all addons are accessible
          * from all around the project
          * through $this->app->getInitiatedAddons()
          */
         $this->addons[$init->api_var] = $init;
         if ($init->with_pages) {
             $init->routePages($init->api_var);
         }
     }
 }
Exemplo n.º 11
0
 function init()
 {
     parent::init();
 }