Example #1
0
 public function init()
 {
     Application::getInstance()->setSessionAttribute($this->getPage()->getRequest(), 'COUNT', 0);
     for ($x = 0; $x < PageAsync::NUMBER_COMPONENTS; $x++) {
         $this->addComponent(new AsyncStallPanel("async_{$x}"));
     }
     for ($x = 0; $x < PageAsync::NUMBER_COMPONENTS; $x++) {
         $this->addComponent(new SyncStallPanel("sync_{$x}"));
     }
 }
Example #2
0
 public function __construct()
 {
     parent::__construct(array(CricketApp::CONFIG_SESSION => CricketApp::PHP_SESSION, CricketApp::CONFIG_PHP_SESSION => array(CricketApp::PHP_SESSION_EXPIRE => 0, CricketApp::PHP_SESSION_NAME => "example1", CricketApp::PHP_SESSION_PATH => Dispatcher::getInstance()->getRequest()->getContextUri())));
 }
Example #3
0
 /**
  * Clear a key value pair from the session
  * 
  * @param string $key
  * 
  * @return void
  */
 public function clearAppSession($key)
 {
     Application::getInstance()->clearSessionAttribute($this->getRequest(), $key);
 }
Example #4
0
 /**
  * Create an action URL
  * 
  * @see \cricket\core\Container::getActionUrl($inActionID)
  * 
  * @return URL
  */
 public function getActionUrl($inActionID, $inPageClassName = null)
 {
     $module = null;
     $instanceID = $this->getInstanceID();
     if ($inPageClassName === null) {
         $inPageClassName = get_class($this);
         $module = $this->getModule();
     } else {
         list($module, $class) = Application::getInstance()->pageClass2ModuleAndPageID($inPageClassName);
     }
     if ($module == null) {
         throw new \Exception("Can't locate module for class: {$inPageClassName}");
     }
     return $module->assembleURL($this->getRequest(), $inPageClassName, $inActionID, $instanceID);
 }
Example #5
0
 /**
  * Returns (space-separated) class names associated with the given key
  * 
  * @param string $key
  */
 public function getClasses($key)
 {
     $app = Application::getInstance();
     if (method_exists($app, 'getFEComponentClasses')) {
         return $app->getFEComponentClasses($key);
     } else {
         error_log('Application does not implement "getFEComponentClasses($key) method. $cricket->getClasses() will not function correctly"');
         return '';
     }
 }