Example #1
0
 public function testGetBadServiceType()
 {
     $di = new Di();
     $di->set('badservice', array());
     $this->setExpectedException('\\Centreon\\Internal\\Exception', "Bad type of service");
     $di->get('badservice');
 }
Example #2
0
 /**
  * Constructor
  *
  * @param string $name The name of form
  * @param array $options The options
  */
 public function __construct($name, $options = null)
 {
     $this->formProcessor = new \HTML_QuickForm($name, 'post');
     $this->formName = $name;
     $this->options = $options;
     $this->init();
     $this->di = Di::getDefault();
     $this->tpl = $this->di->get('template');
 }
 /**
  * Initialize page
  *
  */
 protected function init()
 {
     $this->di = Di::getDefault();
     /* Init template */
     $this->tpl = $this->di->get('template');
     /* Load CssFile */
     $this->tpl->addCss('jquery.dataTables.min.css')->addCss('dataTables.tableTools.min.css')->addCss('dataTables.colVis.min.css')->addCss('dataTables.colReorder.min.css')->addCss('dataTables.bootstrap.css')->addCss('select2.css')->addCss('select2-bootstrap.css')->addCss('centreon-wizard.css');
     /* Load JsFile */
     $this->tpl->addJs('jquery.dataTables.min.js')->addJs('dataTables.tableTools.min.js')->addJs('dataTables.colVis.min.js')->addJs('dataTables.colReorder.min.js')->addJs('bootstrap-dataTables-paging.js')->addJs('jquery.dataTables.columnFilter.js')->addJs('dataTables.bootstrap.js')->addJs('jquery.select2/select2.min.js')->addJs('jquery.validation/jquery.validate.min.js')->addJs('jquery.validation/additional-methods.min.js')->addJs('centreon-wizard.js');
     $this->tpl->assign('datatableObject', $this->datatableObject);
     parent::init();
 }
Example #4
0
 /**
  * Load application constant
  *
  * Load module constant if database is loaded
  */
 private function initConstants()
 {
     require $this->di->get('config')->get('global', 'centreon_path') . '/core/internal/Constant.php';
     try {
         $this->di->get('db_centreon');
         foreach (Module::getModuleList() as $moduleName) {
             $modulePath = Module::getModulePath($moduleName);
             if (file_exists($modulePath . '/config/Constant.php')) {
                 require $modulePath . '/config/Constant.php';
             }
         }
     } catch (\Exception $e) {
     }
 }