예제 #1
0
//  Open source and free to use for good in this world.
//
//  If we've missed a credit, or you simply deserve more
//  credit today, just let us know. Thank you!!!
//
//  An MVC without the V. Or with a small v. ;)
//  Thank you for shopping at indexhibit.org
// -----------------------------------------------------------
if (file_exists('config/config.php')) {
    require_once 'config/config.php';
}
require_once 'defaults.php';
require_once 'bootstrap.php';
require_once 'common.php';
// preloading things
load_helpers(array('html', 'entrance', 'time', 'server'));
// general tools for loading things
load_class('core', false, 'lib');
// "I'm digging for fire" - Pixies
$OBJ =& load_class('router', true, 'lib');
// are we logged in?
$OBJ->access->checkLogin();
// get user prefernces
$OBJ->lang->setlang($OBJ->access->prefs['user_lang']);
// loading our module object
$INDX =& load_class($go['a'], true, 'mod', true);
// referencing wonkiness
// review when there is time
$aINDX =& $INDX;
// loading our module method
$OBJ->tunnel($aINDX, $go['a'], $go['q']);
예제 #2
0
파일: App.php 프로젝트: hutchike/notex
<?php

load_helpers('Twitter', 'Translate');
class App_controller extends Controller
{
    public function before()
    {
        // Setup extra configuration, e.g. Twitter
        $config = Config::load('notex');
        Config::define_constants($config['twitter']);
        Config::define_constants($config['notes']);
        // Setup global variables and rendering data
        $uri = $_SERVER['REQUEST_URI'];
        $this->render->username = $this->username = $this->username_from_host();
        $this->render->screen_name = $this->screen_name = Twitter::screen_name($this->session->access_token);
        $this->render->is_owner = $this->is_owner = $this->screen_name && $this->screen_name == $this->username;
        $this->render->copy = '';
        $this->render->debug = '';
        $this->render->layout = 'notepad';
        $this->host_ip = array_key($_SERVER, 'HTTP_X_FORWARDED_FOR', $_SERVER['REMOTE_ADDR']);
        $title = ($this->username ? $this->username . '.' : '') . 'noted.cc';
        $title .= $uri == '/' ? ' | web notepad' : $uri;
        $this->render->title = $title;
        // Handle alternative content types, e.g. XML and JSON
        $type = $this->app->get_content_type();
        if ($type != 'html') {
            $this->respond_with_data_as($type);
        }
    }
    public function respond_with_data_as($type)
    {
예제 #3
0
파일: utils.php 프로젝트: hutchike/YAWF
/**
 * Load a helper
 *
 * @param String $helper the helper to load
 */
function load_helper($helper)
{
    load_helpers($helper);
}
예제 #4
0
        if (file_exists("framework" . DS . "lib" . DS . "controller" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "lib" . DS . "controller" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "widgets" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "widgets" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "plugins" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "plugins" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "lib" . DS . "filter" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "lib" . DS . "filter" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "lib" . DS . "locale" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "lib" . DS . "locale" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "lib" . DS . "soap" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "lib" . DS . "soap" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "lib" . DS . "error" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "lib" . DS . "error" . DS . "{$class}.class.php";
        }
        if (file_exists("framework" . DS . "lib" . DS . "rest" . DS . "{$class}.class.php")) {
            require_once "framework" . DS . "lib" . DS . "rest" . DS . "{$class}.class.php";
        }
    }
    load_models();
    load_helpers();
    load_widgets();
} catch (Exception $ex) {
    print $ex->getMessage();
}
예제 #5
0
 function sbmt_edit_sec()
 {
     global $go;
     $processor =& load_class('processor', true, 'lib');
     $temp['hsec_ord'] = $processor->process('hsec_ord', array('digit'));
     $temp['hsecid'] = $processor->process('hsecid', array('digit'));
     $clean['sec_desc'] = $processor->process('sec_desc', array('notags', 'reqnotempty'));
     $clean['section'] = $processor->process('section', array('nophp', 'reqnotempty'));
     $clean['sec_proj'] = $processor->process('sec_proj', array('boolean'));
     $clean['sec_report'] = $processor->process('sec_report', array('boolean'));
     $clean['sec_disp'] = $processor->process('sec_disp', array('boolean'));
     $clean['sec_ord'] = $processor->process('sec_ord', array('digit'));
     if ($processor->check_errors()) {
         // get our error messages
         $error_msg = $processor->get_errors();
         $this->errors = true;
         $GLOBALS['error_msg'] = $error_msg;
         return;
     } else {
         if ($clean['sec_proj'] === 1) {
             // update all sections with sec_proj = 0
             $this->db->updateArray('section', array('sec_proj' => 0));
         }
         // so nice and messy!
         if ($clean['sec_ord'] !== $temp['hsec_ord']) {
             // we need to reorder things
             if ($clean['sec_ord'] > $temp['hsec_ord']) {
                 $this->db->updateArray('section', array('sec_ord' => 'sec_ord - 1'), "(sec_ord > '{$temp['hsec_ord']}') AND (sec_ord <= '{$clean['sec_ord']}')");
             } elseif ($clean['sec_ord'] < $temp['hsec_ord']) {
                 $this->db->updateArray('section', array('sec_ord' => 'sec_ord + 1'), "(sec_ord < '{$temp['hsec_ord']}') AND (sec_ord >= '{$clean['sec_ord']}')");
             } else {
                 // do nothing here
             }
         }
         // we need to romanize the path based upon 'section'
         load_helpers(array('output', 'romanize'));
         $folder_name = load_class('publish', true, 'lib');
         $folder_name->title = trim($clean['section']);
         $clean['section'] = $folder_name->processTitle();
         if ($go['id'] !== 1) {
             // you can update the sec_path
             $clean['sec_path'] = '/' . $clean['section'];
         }
         $this->db->updateArray('section', $clean, "secid='{$go['id']}'");
         // send an update notice
         $this->template->action_update = 'updated';
     }
 }