Esempio n. 1
0
 public function configure()
 {
     global $_FAPP;
     if (!$_FAPP['templating']) {
         global $configs;
     }
     $configs = new ModuleConfigs();
     $configs->getForModule('users');
     if ($_FAPP['templating']) {
         FabriqTemplates::set_var('module_configs', $configs);
     }
     if (isset($_POST['submit'])) {
         $configs[$configs->configs['anyoneCanRegister']]->val = $_POST['anyoneCanRegister'];
         $configs->update($configs->configs['anyoneCanRegister']);
         Fabriq::render('none');
         echo json_encode(array('success' => true));
     }
 }
 /**
  * Adds the output of this view to the body variable that is appended to the
  * FabriqModules class' $body variable. For rendering one module at a time,
  * use FabriqModules::render_now();
  * @param string $module
  * @param string $action
  */
 public static function render($module, $action)
 {
     $render = new stdClass();
     $render->controller = $module;
     $render->action = $action;
     $render->type = 'module';
     FabriqTemplates::renderToBody($render);
 }
Esempio n. 3
0
 /**
  * Process everything the queue
  */
 public static function processQueue()
 {
     if (!count(self::$queue)) {
         return false;
     }
     $next = FabriqStack::dequeue();
     while ($next->controller == '') {
         if (!count(self::$queue)) {
             return false;
         }
         FabriqStack::processQueue();
     }
     self::$processing = $next;
     switch ($next->type) {
         case 'module':
             $module =& FabriqModules::module($next->controller);
             call_user_func_array(array($module, $next->action), $next->extra);
             if (Fabriq::render() != 'none' && FabriqModules::has_permission() && !FabriqModules::stopMappedRender()) {
                 FabriqTemplates::renderToBody($next);
             }
             break;
         case 'controller':
         default:
             PathMap::controller($next->controller);
             PathMap::action($next->action);
             $file = "app/controllers/{$next->controller}.controller.php";
             if (file_exists('sites/' . FabriqStack::site() . "/{$file}")) {
                 require_once 'sites/' . FabriqStack::site() . "/{$file}";
             } else {
                 require_once $file;
             }
             $c = "{$next->controller}_controller";
             $controller = new $c();
             $a = str_replace('.', '_', $next->action);
             if (!$controller->hasMethod($a)) {
                 FabriqStack::error(404);
             }
             call_user_func(array($controller, $a));
             FabriqTemplates::renderToBody($next);
             break;
     }
     if (count(self::$queue)) {
         FabriqStack::processQueue();
     }
 }
    if (PathMap::arg(2) == 3) {
        echo ' class="current"';
    }
    ?>
>Module updates</li>
			<li<?php 
    if (PathMap::arg(2) == 4) {
        echo ' class="current"';
    }
    ?>
>Finish</li>
		</ul>
		<div class="clearbox">&nbsp;</div>
	</section>
</nav>
<?php 
}
?>

<section id="body">
	<section id="content">

<?php 
echo FabriqTemplates::body();
?>

	</section>
</section>

</body>
</html>
 /**
  * Install step 5
  * Display message about end of install and finish installation
  */
 protected function install_step5()
 {
     Fabriq::title('Install complete');
     FabriqTemplates::template('fabriqinstall');
     // delete session variables
     unset($_SESSION['FAB_INSTALL_site']);
     unset($_SESSION['FAB_INSTALL_db']);
     unset($_SESSION['FAB_INSTALL_mods_installed']);
 }
Esempio n. 6
0
    $aPath = str_replace('index.php?q=', '', $aPath);
    $aPath = explode('/', $aPath);
    $i = 0;
    while ($aPath[$i] != 'fabriqinstall' && $i < count($aPath)) {
        $appPath .= $aPath[$i] . '/';
        $i++;
    }
    $_FAPP['url'] = "http://{$_SERVER['HTTP_HOST']}";
    $_FAPP['apppath'] = str_replace('//', '/', $appPath);
}
// require the core files
FabriqStack::requireCore();
// check if user is logged in and if not give viewer
// unathenticated role
FabriqStack::checkUserStatus();
// determine the controller and action to render
PathMap::map_path();
// determine which template to set initially
FabriqTemplates::init();
// include the controller and action files
if (file_exists('sites/' . FabriqStack::site() . '/app/controllers/application.controller.php')) {
    require_once 'sites/' . FabriqStack::site() . '/app/controllers/application.controller.php';
} else {
    require_once 'app/controllers/application.controller.php';
}
FabriqStack::processQueue();
FabriqTemplates::render();
// close the database connection
if ($installed) {
    $db->close();
}