Beispiel #1
0
 public function __construct($locale)
 {
     include LIB_DIR . 'docbook/src/docbook.core.php';
     include LIB_DIR . 'docbook/src/docbook.html.php';
     include LIB_DIR . 'docbook/src/docbook.srcparser.php';
     include LIB_DIR . 'docbook/src/docbook.apidoc.php';
     $doc = new \Docbook\APIdoc('res/docs/index.xml', 1);
     $doc->setSCRPath(API_DIR);
     $doc->setImgURL('res/docs/img/');
     $doc->setDemoURL(\Xily\Config::get('app.url') . 'index.php');
     // $doc->addInclude('<link media="all" rel="stylesheet" type="text/css" href="./assets/lib/bootstrap/css/bootstrap.min.css" />');
     // $doc->addInclude('<link media="all" rel="stylesheet" type="text/css" href="./assets/lib/bootstrap/css/bootstrap-responsive.min.css" />');
     $doc->addInclude('<script type="text/javascript" src="./assets/lib/mootools/mootools-core-1.4.4.js"></script>');
     $doc->addInclude('<script type="text/javascript" src="./assets/lib/mootools/mootools-more-1.4.0.1.js"></script>');
     $data = new \Xily\Dictionary($doc->parse());
     /*
     $toc = '<ul class="nav nav-list">';
     foreach ($data->get('sections') as $key => $value) {
     	$toc .= '<li class="lev'.substr_count($key, '.').'"><a href="#sect'.$key.'" style="padding-left: '.(substr_count($key, '.') * 10).'px">'.$value.'</a></li>';
     }
     $toc .= '</ul>';
     $data->set('toc', $toc);
     $data->set('css', file_get_contents('lib/docbook/html/apidoc.dyn.css'));
     */
     die($data->insertInto(file_get_contents('lib/docbook/html/apidoc.frame.html')));
 }
Beispiel #2
0
/**
 * Creates a link to an application view
 *
 * @param sting $view
 * @param string $index
 * @return string
 */
function buildLink($view, $index = false)
{
    if (\Xily\Config::get('app.seo') == 1) {
        return \Xily\Config::getDir('app.url') . $view . ($index ? '/' . $index : '');
    } else {
        return 'index.php?view=' . $view . ($index ? '&index=' . $index : '');
    }
}
Beispiel #3
0
 /**
  * Contructs the docbook object
  *
  * @param string|\Xily\Xml $mxtDoc The \Xily\Xml object or an XML document or file
  * @param bool $bolLoadFile Load the XML data from a file
  */
 public function __construct($mxtDoc, $bolLoadFile = false)
 {
     $this->extend();
     $this->setImgPath(\Xily\Config::get('doc.imgpath'));
     if ($mxtDoc instanceof \Xily\Xml) {
         $this->xmlDoc = $mxtDoc;
     } elseif (!($this->xmlDoc = \Xily\Xml::create($mxtDoc, $bolLoadFile))) {
         return false;
     }
     $this->build();
     $this->arrConverterKeys = array_keys($this->arrConverters);
     if ($bolLoadFile) {
         $this->setIncludePath(realpath(dirname($mxtDoc)));
     }
     return true;
 }
Beispiel #4
0
<?php

// This file generated by Propel 1.6.1 convert-conf target
// from XML runtime conf file Z:\htdocs\tymio\lib\entities\runtime-conf.xml
$conf = array('datasources' => array('tymio' => array('adapter' => \Xily\Config::get('db.type'), 'connection' => array('dsn' => \Xily\Config::get('db.type') . ':host=' . \Xily\Config::get('db.host') . ';dbname=' . \Xily\Config::get('db.name'), 'database' => \Xily\Config::get('db.name'), 'user' => \Xily\Config::get('db.user'), 'password' => \Xily\Config::get('db.password'))), 'default' => 'tymio'), 'generator_version' => '1.6.9');
$conf['classmap'] = (include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-tymio-conf.php');
return $conf;
Beispiel #5
0
 /**
  * @return Authenticator
  */
 public static function getAuthenticator()
 {
     if (self::$authenticator === null) {
         self::$authenticator = new Authenticator();
         $cookieSalt = \Xily\Config::get('app.salt', 'string', '');
         if ((string) $cookieSalt !== '') {
             self::$authenticator->salt = $cookieSalt;
         }
     }
     return self::$authenticator;
 }
Beispiel #6
0
 /**
  * Returns the user authenticated by the supplied login name and password.
  *
  * @param string $loginName
  * @param string $password The password.
  * @param PropelPDO $con Optional. The database connection to use.
  *     Default is NULL.
  * @return User|null The {@link User} object, or NULL on failure.
  * @uses verifyPassword()
  * @see UserQuery
  */
 public static function getAuthenticatedUser($loginName, $password, PropelPDO $con = null)
 {
     $user = UserQuery::create()->findOneByFQN($loginName, $con);
     if ($user === null) {
         $user = UserQuery::create()->findOneByEmail($loginName, $con);
     }
     if ($user === null) {
         return null;
     } elseif (\Xily\Config::get('app.useldap', 'bool', false) && self::ldapAuthenticate($user, $password, $con)) {
         return $user;
     } else {
         return self::verifyPassword($password, $user->getPasswordHash()) ? $user : null;
     }
 }
Beispiel #7
0
 public function load_view()
 {
     $view = array_key_exists('view', $_REQUEST) ? $_REQUEST['view'] : 'login';
     if (!in_array($view, $noauth) && !array_key_exists('user', $_SESSION) && !(isset($_REQUEST['user']) && API::validateUser($_REQUEST['user'], isset($_REQUEST['password']) ? $_REQUEST['password'] : ''))) {
         $view = 'login';
     } elseif ($view == 'login') {
         // If logged-in go directly to the home screen
         $view = 'home';
     }
     // Check, if there is a controller for the view
     if (file_exists('controllers/' . $view . '.php')) {
         include 'controllers/' . $view . '.php';
     }
     $controllerClass = $view . 'Controller';
     if (class_exists($controllerClass)) {
         $controller = new $controllerClass($locator);
         $xlyPage = $controller->getView();
     } else {
         $file = 'views/' . $view . '.xml';
         if (!file_exists($file)) {
             $file = 'views/404.xml';
         }
         $xlyPage = \Xily\Bean::create($locator->insert(file_get_contents($file)));
     }
     if (!$xlyPage->hasAttribute('id')) {
         $xlyPage->setAttribute('id', $view);
     }
     $xlyPage->setDataset($_GET, 'get');
     $xlyPage->setDataset(\Xily\Config::getDir('app.url'), 'url');
     $xlyPage->setDataset($_POST, 'post');
     $xlyPage->setDataset($_REQUEST, 'request');
     $xlyPage->locator = $locator;
     echo $xlyPage->run();
 }
Beispiel #8
0
                // Check if the module has a controller
                if (file_exists(MODULE_DIR . $view . '/' . $view . '.php')) {
                    include_once MODULE_DIR . $view . '/' . $view . '.php';
                }
                if (class_exists($controllerClass)) {
                    $controller = new $controllerClass($locale);
                    $xlyPage = $controller->getView();
                } else {
                    if (file_exists(MODULE_DIR . $view . '/' . $view . '.xml')) {
                        $xlyPage = \Xily\Bean::create($locale->replace(file_get_contents(MODULE_DIR . $view . '/' . $view . '.xml')));
                    }
                }
            }
            if (!isset($xlyPage)) {
                $xlyPage = \Xily\Bean::create($locale->replace(file_get_contents(VIEW_DIR . (file_exists(VIEW_DIR . $view . '.xml') ? $view : '404') . '.xml')));
            }
        }
        if (!$xlyPage->id()) {
            $xlyPage->setAttribute('id', $view);
        }
        $xlyPage->setDataset($_GET, 'get');
        $xlyPage->setDataset(\Xily\Config::getDir('app.url'), 'url');
        $xlyPage->setDataset($_POST, 'post');
        $xlyPage->setDataset($_REQUEST, 'request');
        $xlyPage->setAttribute('lang', $locale->getCurrent());
        echo $xlyPage->run($xmlMeta);
    }
} catch (Exception $e) {
    $xlyError = \Xily\Bean::create($locale->replace(file_get_contents(VIEW_DIR . 'error.xml')));
    echo $xlyError->run(array('message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => str_replace("\n", '<br />', htmlentities(KickstartErrorTrace($e)))));
}
Beispiel #9
0
require LIB_DIR . '/kickstart/kickstart.localizer.php';
require LIB_DIR . '/kickstart/kickstart.validator.php';
require LIB_DIR . '/kickstart/utils.excel.php';
require LIB_DIR . '/kickstart/compatibility.php';
require LIB_DIR . '/kickstart/form.php';
require LIB_DIR . '/kickstart/html.php';
require LIB_DIR . '/kickstart/http.php';
require LIB_DIR . '/kickstart/keyreplace.php';
require LIB_DIR . '/kickstart/ldap.php';
require LIB_DIR . '/kickstart/recentlist.php';
require LIB_DIR . '/kickstart/session.php';
require LIB_DIR . '/kickstart/util.php';
require LIB_DIR . '/cryptastic/cryptastic.class.php';
require LIB_DIR . '/spyc/spyc.php';
require LIB_DIR . '/tymio/controller.class.php';
require LIB_DIR . '/tymio/localizer.class.php';
require LIB_DIR . '/tymio/api.class.php';
require LIB_DIR . '/tymio/util.inc.php';
require LIB_DIR . '/tymio/ixml.inc.php';
require LIB_DIR . '/tymio/entityarray.php';
require LIB_DIR . '/tymio/search.php';
require APP_DIR . '/api/account.php';
require APP_DIR . '/api/clocking.php';
require APP_DIR . '/api/domain.php';
require APP_DIR . '/api/holiday.php';
require APP_DIR . '/api/plugin.php';
require APP_DIR . '/api/transaction.php';
require APP_DIR . '/api/user.php';
$locale = Localizer::getInstance($langAccepted, $langDefault);
$locale->load(APP_DIR . 'locales', \Xily\Config::get('app.cache', 'bool', false) ? CACHE_DIR . 'locales' : false);