Esempio n. 1
0
 /**
  * Constructor
  * @param string $pageQueryStr The customized page query string name
  */
 public function __construct($pageQueryStr = '')
 {
     if ($pageQueryStr) {
         $this->pageQueryStr = $pageQueryStr;
     }
     $page = _arg($this->pageQueryStr);
     $this->page = $page ? $page : 1;
 }
Esempio n. 2
0
<?php

include _i('inc/authenticate.php');
$id = _arg(3);
if ($id) {
    $pageTitle = 'Edit User';
} else {
    $id = 0;
    $pageTitle = 'Add New User';
}
include 'query.php';
?>
<!DOCTYPE html>
<html lang="<?php 
echo _lang();
?>
">
<head>
    <title><?php 
echo _title($pageTitle);
?>
</title>
    <?php 
include _i('inc/tpl/head.php');
?>
</head>
<body>
    <?php 
include 'view.php';
?>
</body>
Esempio n. 3
0
<?php

/**
 * The index.php (required) serves as the front controller for the requested page,
 * initializing the base resources needed to run the page
 */
$pageTitle = _t('AsynFileUploader Example');
$id = _arg(2);
include 'query.php';
?>
<!DOCTYPE html>
<html>
<head>
    <title><?php 
echo _title($pageTitle);
?>
</title>
    <?php 
include _i('inc/tpl/head.php');
?>
    <style type="text/css">
        .asynfileuploader-button {
            width: 106px;
        }
        .table .col {
            margin-right: 20px;
        }
        .thumbnail a {
            color: #8c8c8c;
        }
    </style>
/**
 * @internal
 *
 * Route to a page according to request
 * interally called by /app/index.php
 *
 * @return string
 */
function router()
{
    global $lc_homeRouting;
    # Get a route from the defined custom routes (if any)
    $_page = route_match();
    if ($_page) {
        return route_getAbsolutePathToRoot($_page);
    }
    $q = route_path();
    # if the route is empty, get it from the config
    if (empty($q) && $lc_homeRouting) {
        $q = $lc_homeRouting;
    }
    # if it is still empty, set it to the system default
    if (empty($q)) {
        $q = 'home';
    }
    # Get the complete path to root
    $_page = route_getAbsolutePathToRoot($q);
    if (!empty($_page) && file_exists($_page)) {
        return $_page;
    }
    if (preg_match('/(.*)(401|403|404) {1}$/', $_page, $matches)) {
        return _i('inc/tpl/' . $matches[2] . '.php');
    }
    # Search the physical directory according to the routing path
    $_page = route_search();
    if ($_page && is_file($_page) && file_exists($_page)) {
        return $_page;
    }
    if (in_array(_arg(0), array('401', '403'))) {
        return _i('inc/tpl/' . _arg(0) . '.php');
    } else {
        return _i('inc/tpl/404.php');
    }
}
Esempio n. 5
0
}
?>
><?php 
echo _t('Categories');
?>
</a>
                    </li>
                    <?php 
if (auth_isAdmin()) {
    ?>
                    <li>
                        <a href="<?php 
    echo _url('admin/user');
    ?>
" <?php 
    if (_arg(1) == 'user') {
        echo 'class="active"';
    }
    ?>
><?php 
    echo _t('Users');
    ?>
</a>
                    </li>
                    <?php 
}
?>
                </ul>
            </div>
        </div>
        <div id="page">
Esempio n. 6
0
" <?php 
if (_arg(1) == 'asyn-file-uploader') {
    echo 'class="active"';
}
?>
 title="AsynFileUploader Example"><?php 
echo _t('Example 6');
?>
</a>
                    </li>
                    <li>
                        <a href="<?php 
echo _url('example/layout');
?>
" <?php 
if (_arg(1) == 'layout') {
    echo 'class="active"';
}
?>
 title="Layout Mode Example"><?php 
echo _t('Example 7');
?>
</a>
                    </li>
                    <li>
                        <a href="http://www.phplucidframe.com/downloads" target="_blank"><?php 
echo _t('Downloads');
?>
</a>
                    </li>
                    <li>
Esempio n. 7
0
<?php

if (auth_isAnonymous()) {
    flash_set(_t('Your session is expired.'), '', 'error');
    _redirect('admin/login');
}
$timestamp = _arg(2);
if ($timestamp) {
    if ($timestamp == $_auth->timestamp) {
        # Normal logout process
        auth_clear();
        flash_set(_t('You have signed out successfully.'));
        _redirect('admin/login');
    }
}
/**
 * Get the language to process
 * Read "lang" from query string; if it is not found, get the default language code
 * Basically, it is useful for admin content management by language
 * Hook to implement `__getLang()` at app/helpers/utility_helper.php
 *
 * @return string The language code
 */
function _getLang()
{
    if (function_exists('__getLang')) {
        return __getLang();
        # run the hook if any
    }
    $lang = _arg('lang') ? _arg('lang') : _defaultLang();
    return $lang ? $lang : _defaultLang();
}
<?php

if (auth_isAnonymous()) {
    flash_set('You are not authenticated. Please log in.', '', 'error');
    _redirect('admin/login');
} else {
    if (auth_isEditor() && _arg(1) == 'user') {
        _page401();
    }
}