/**
  * Create a new instance of a page.
  * 
  * The default constructor should be called by any pages extending this object.  It creates the
  * {@link I2CE_Template} and {@link I2CE_User} objects and sets up the basic member variables.
  * @param array $args
  * @param array $request_remainder The remainder of the request path
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     $this->cli = new I2CE_CLI();
     $this->cli->addUsage("[--delete=XXXX]: The form|id to delete.  If not set, then user will be prompted.\n");
     parent::__construct($args, $request_remainder, $get, $post);
     $this->cli->processArgs();
 }
 /**
  * Constructor -- called from page wrangler for URL of form admin/(module_name)/action/arg1/arg2
  * @param string $shortname A module name to show the admin page for. Defaults to null to mean no module.
  * @param string $action The action this pages is to perform
  * @param array $args an array of strings
  * @param string $message. A message to display on the page.  Defaults to null
  */
 public function __construct($args, $request_remainder)
 {
     parent::__construct($args, $request_remainder);
     $this->config_path = $request_remainder;
     $create = !($this->page == 'load');
     $this->config = I2CE::getConfig()->traverse($this->config_path, $create, false);
 }
 /**
  * Create a new instance of a page.
  * 
  * The default constructor should be called by any pages extending this object.  It creates the
  * {@link I2CE_Template} and {@link I2CE_User} objects and sets up the basic member variables.
  * @param array $args
  * @param array $request_remainder The remainder of the request path
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     $this->form_factory = I2CE_FormFactory::instance();
     $this->check_map = I2CE_ModuleFactory::instance()->isEnabled("Lists");
     $this->locale = I2CE_Locales::DEFAULT_LOCALE;
 }
Ejemplo n.º 4
0
 /**
  * Create a new instance of this web service page.
  * @param array $args
  * @param array $request_remainder
  * @param array $get
  * @param array $post 
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     $this->config = I2CE::getConfig()->traverse("/modules/web-services");
     $this->err_msgs = array();
     //Override the permission parser template to be this object since there is no template and it
     //should only be needed for user details.
     $this->permissionParser = new I2CE_PermissionParser($this);
 }
Ejemplo n.º 5
0
 /**
  * Constructor -- called from page wrangler for URL of form admin/(module_name)/action/arg1/arg2
  * @param string $shortname A module name to show the admin page for. Defaults to null to mean no module.
  * @param string $action The action this pages is to perform
  * @param array $args an array of strings
  * @param string $message. A message to display on the page.  Defaults to null
  */
 public function __construct($args, $request_remainder)
 {
     parent::__construct($args, $request_remainder);
     if (count($request_remainder) == 0) {
         $this->shortname = 'I2CE';
     } else {
         $this->shortname = array_shift($request_remainder);
     }
     $this->mod_factory = I2CE_ModuleFactory::instance();
 }
 /**
  * Create a new instance of a page.
  * 
  * The default constructor should be called by any pages extending this object.  It creates the
  * {@link I2CE_Template} and {@link I2CE_User} objects and sets up the basic member variables.
  * @param array $args
  * @param array $request_remainder The remainder of the request path
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     $this->cli = new I2CE_CLI();
     $this->cli->addUsage("[--relationship=XXXX]: The relationship to export.  If not set, then user will be prompted.\n");
     $this->cli->addUsage("[--description=XXXX]: Optional description to use in the  export\n");
     $this->cli->addUsage("[--version=XXXX]: Optional version to use in the  export\n");
     $this->cli->addUsage("[--display=XXXX]: Optional display name to use in the  export\n");
     $this->cli->addUsage("[--module=XXXX]: Optional module name to use in the  export\n");
     $this->cli->addUsage("[--output=XXXX]: Optional file to ouput to.  \n");
     parent::__construct($args, $request_remainder, $get, $post);
     $this->cli->processArgs();
 }
Ejemplo n.º 7
0
 /**
  * Create a new instance of a page.
  * 
  * The default constructor should be called by any pages extending this object.  It creates the
  * {@link I2CE_Template} and {@link I2CE_User} objects and sets up the basic member variables.
  * @param array $args
  * @param array $request_remainder The remainder of the request path
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     $this->config = I2CE::getConfig()->modules->admin->cron;
     $this->types = $this->config->types->getAsArray();
     $this->cli = new I2CE_CLI();
     $this->cli->addUsage("[--type=XXXX]: The type of cron to run.  If not set, the system will determine\n");
     $this->cli->addUsage("               what to run based on recent run times.\n");
     $this->cli->addUsage("               Possible values are:  " . implode(', ', array_keys($this->types)) . "\n");
     $this->cli->addUsage("               If the most recently run cron hasn't finished for a type then it\n");
     $this->cli->addUsage("               will not run again.\n");
     $this->cli->addUsage("[--silent=true|false]: Determine if standard messages will be shown or not.\n");
     $this->cli->addUsage("                       Defaults to: false\n");
     parent::__construct($args, $request_remainder, $get, $post);
     $this->cli->processArgs();
 }
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     if (array_key_exists('il_hwr_host', $this->args) && is_scalar($this->args['il_hwr_host'])) {
         $this->il_hwr_host = $this->args['il_hwr_host'];
     }
     if ($this->request_exists('id')) {
         $id = $this->request('id');
         I2CE::raiseError("Recevied ({$id})");
         if (($this->person = I2CE_FormFactory::instance()->createContainer($id)) instanceof I2CE_Form) {
             $this->person->populate();
         }
     }
     $this->setForm($this->person);
 }
 public function __construct($args, $request_remainder)
 {
     parent::__construct($args, $request_remainder);
     $this->factory = null;
     $this->swiss_path = '/' . implode('/', $request_remainder);
     try {
         $this->factory = new I2CE_SwissMagicFactory($this);
     } catch (Exception $e) {
         I2CE::raiseError("Could not get swiss factory for {$module}");
     }
     try {
         $this->factory->setRootSwiss();
     } catch (Expection $e) {
         $this->factory = null;
     }
 }
Ejemplo n.º 10
0
 /**
  * Create a new instance of this page.
  * 
  * This will call the parent constructor and then setup the base
  * template pages for the {@link Template template}.  It also sets up the values
  * for the member variables.
  * @param string $title The title for this page.
  * @param string $defaultHTMLFile The default HTML file for this page.
  * @param mixed $access The role required to access this page.
  * @param array $files The list of template files to load for this page.
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     $this->type = "";
     $this->id = 0;
     if ($this->request_exists('type')) {
         $this->type = $this->request('type');
     }
     if ($this->request_exists('id')) {
         $this->id = $this->request('id');
     }
     if (strlen($this->id) > 0 && strpos($this->id, '|') === false) {
         I2CE::raiseError("Deprecated use of id: {$this->id}");
         $this->id = $this->type . '|' . $this->id;
     }
 }
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     if (array_key_exists('server_host', $this->args) && is_scalar($this->args['server_host'])) {
         $this->host = $this->args['server_host'];
     }
     if (array_key_exists('api_token', $this->args) && is_scalar($this->args['api_token'])) {
         $this->token = $this->args['api_token'];
     }
     if (array_key_exists('slug', $this->args) && is_scalar($this->args['slug'])) {
         $this->slug = $this->args['slug'];
     }
     if (array_key_exists('csd_host', $this->args) && is_scalar($this->args['csd_host'])) {
         $this->csd_host = $this->args['csd_host'];
     }
     $this->rapidpro = new CSD_Interface_RapidPro($this->token, $this->host);
 }
Ejemplo n.º 12
0
 /**
  * Constructor method.
  */
 public function __construct($args, $request_remainder)
 {
     parent::__construct($args, array());
     $this->request_remainder = $request_remainder;
     $config = I2CE::getConfig()->modules->FileDump;
     if ($config->is_parent('defaultCategories')) {
         foreach ($config->defaultCategories as $cat => $exts) {
             if (!$exts instanceof I2CE_MagicDataNode) {
                 continue;
             }
             foreach ($exts as $ext) {
                 $this->default_categories[$ext] = $cat;
             }
         }
     }
     $this->allowedCategories = array();
     if (isset($config->limitToCategories)) {
         $this->allowedCategories = $config->limitToCategories->getAsArray();
     }
 }
Ejemplo n.º 13
0
 /**
  * Create a new instance of a form page.
  * 
  * This will call the constructor for all Page objects and then set up some additional
  * member variables for forms.
  * @param string $title The title for this page.
  * @param string $defaultHTMLFile The default HTML file for this page.
  * @param mixed $access The role required to access this page.
  * @param array $files The list of template files to load for this page.
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     $this->template->addHeaderLink('mootools-core.js');
     $this->template->addHeaderLink('I2CE_ClassValues.js');
     $this->template->addHeaderLink('I2CE_SubmitButton.js');
     $this->button_templates = array('button_save' => 'button_save.html', 'button_save_only' => 'button_save_only.html', 'button_save_return' => 'button_save_return.html', 'button_confirm' => 'button_confirm.html', 'button_return_only' => 'button_return_only.html');
     if (array_key_exists('buttons', $this->args) && is_array($this->args['buttons'])) {
         foreach (array_keys($this->button_templates) as $key) {
             if (array_key_exists($key, $this->args['buttons']) && is_string($this->args['buttons'][$key]) && strlen($this->args['buttons'][$key]) > 0) {
                 $this->button_templates[$key] = $this->args['buttons'][$key];
             }
         }
     }
     $this->editing = false;
     $this->factory = I2CE_FormFactory::instance();
     if (array_key_exists('confirm', $args)) {
         $this->usesConfirmPage = $args['confirm'];
     } else {
         $this->usesConfirmPage = true;
     }
 }
 public function __construct($args, $request_remainder)
 {
     parent::__construct($args, $request_remainder);
     $this->factory = null;
     if (count($request_remainder) > 0) {
         $this->module = array_shift($request_remainder);
         $this->swiss_path = '/' . implode('/', $request_remainder);
         try {
             $this->factory = new I2CE_SwissConfigFactory($this, array('module' => $this->module));
         } catch (Exception $e) {
             I2CE::raiseError("Could not get swiss factory for {$this->module}:\n" . $e->getMessage());
             return;
         }
         try {
             $this->factory->setRootSwiss();
         } catch (Expection $e) {
             $this->factory = null;
         }
     } else {
         $this->module = false;
         $this->swiss_path = false;
         $this->factory = null;
     }
 }
 /**
  * Constructor -- called from page wrangler for URL of form admin/(module_name)/action/arg1/arg2
  * @param string $shortname A module name to show the admin page for. Defaults to null to mean no module.
  * @param string $action The action this pages is to perform
  * @param array $args an array of strings
  */
 public function __construct($args, $request_remainder, $get = null, $post = null)
 {
     parent::__construct($args, $request_remainder, $get, $post);
     $this->configPath = $request_remainder;
 }
 public function __construct()
 {
     parent::__construct(array('access' => 'admin', 'title' => 'update salary history', 'templates' => array('history.html'), 'defaultHTMLFile' => 'history.html'), array());
 }