protected function startup()
 {
     parent::startup();
     \Stopwatch::start('BasePresenter');
     AntispamControl::register();
     AntispamControl::$minDelay = 2;
     if ($this->isAjax()) {
         $this->payload->doNotSave = false;
     }
     //$this->getSession('agility')->setExpiration('+ 1 years'); // set up session
     $this->permissionRepository = $this->context->permissionRepository;
     $this->itemRepository = $this->context->itemRepository;
     $this->calendarRepository = $this->context->calendarRepository;
     $this->pages = $this->context->parameters["pageLayout"];
     /** 
      * Create list of used JS and CSS files 
      */
     $this->jsFiles = array(APP_DIR . '/templates/javascript/libs/jquery-1.8.2.min.js', APP_DIR . '/templates/javascript/libs/jquery-ui-1.9.1.custom.min.js', APP_DIR . '/templates/javascript/libs/transify-min.js', APP_DIR . '/templates/javascript/libs/nette.ajax.js', APP_DIR . '/templates/javascript/libs/nette-extension/spinner.ajax.js', APP_DIR . '/templates/javascript/libs/nette-extension/diagnostics.dumps.ajax.js', APP_DIR . '/templates/javascript/libs/netteForms-live.js', APP_DIR . '/templates/javascript/libs/nette-extension/history.ajax.js', 'init.js', 'ui.js', 'calendar.js');
     $this->jsFilesIE['mediaQuery'] = 'ie.mediaqueries.replacement.js';
     $this->cssFiles = array('jqueryui' => 'jquery-ui-1.9.1.custom.min.css', 'calendart' => 'eventCalendar.less', 'screen' => 'screen.less', 'screen.layout' => 'screen.layout.less', 'screen.content' => 'screen.content.less', 'screen.colors' => 'screen.colors.less');
     $this->cssFilesOldIE['IE'] = APP_DIR . '/templates/less/screen.old.ie.less';
     $this->cssFilesPrint['print'] = 'print.less';
     if ($this->getUser()->isLoggedIn()) {
         $this->jsFiles[] = 'admin.js';
     }
 }
Exemple #2
0
 public function startup()
 {
     parent::startup();
     \AntispamControl::register();
     $this->productionMode = $this->context->parameters['productionMode'];
     $this->sendEmails = $this->context->parameters['sendEmails'];
     $this->template->productionMode = $this->productionMode;
 }
 public function startup()
 {
     parent::startup();
     \AntispamControl::register();
 }
Exemple #4
0
// Load Nette Framework or autoloader generated by Composer
require __DIR__ . '/../vendor/autoload.php';
$configurator = new \Nette\Configurator();
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode(TRUE);
$configurator->enableDebugger(__DIR__ . '/../log', '*****@*****.**');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../libs')->register();
define("WWW_DIR", __DIR__ . '/../www');
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
if (file_exists(__DIR__ . '/config/config.local.neon')) {
    $configurator->addConfig(__DIR__ . '/config/config.local.neon');
}
\AntispamControl::register();
$help = <<<HELP

Please configure connection to the database first! Use following options:
\tphp index.php -u <db-user> -n <db-name> [-p <db-pass>] [-d <db-driver=mysql|pgsql>]

HELP;
if (file_exists(__DIR__ . '/config/config.local.neon')) {
    $config = \Nette\Neon\Neon::decode(file_get_contents(__DIR__ . '/config/config.local.neon'));
}
if (isset($config) && is_array($config) && array_key_exists('doctrine', $config)) {
    return $configurator->createContainer();
} elseif (PHP_SAPI === 'cli') {
    $options = getopt('u:n:p:d:');
    if (!isset($options['u']) || !isset($options['n'])) {
        die($help);