コード例 #1
0
ファイル: adminlist.php プロジェクト: phangoapp/admin
function AdminListView($admin)
{
    echo View::show_flash();
    if ($admin->list->yes_search == 1) {
        $admin->list->search_by_url();
        $select = new SelectForm('field_search', $_GET['field_search']);
        //$select->arr_select=$admin->list->load_fields_showed($admin->list->arr_fields_no_search);
        foreach ($admin->list->arr_fields_search as $field) {
            $select->arr_select[$field] = Webmodel::$model[$admin->model_name]->forms[$field]->label;
        }
        if ($_GET['field_search'] == '') {
            $select->default_value = $admin->list->default_field_search;
        }
        $select_order = new SelectForm('order', $_GET['order']);
        $select_order->arr_select = array(0 => I18n::lang('common', 'asc', 'Ascendent'), 1 => I18n::lang('common', 'desc', 'Descendent'));
        $search = new BaseForm('search', $_GET['search']);
        ?>
        <div class="cont search">
            <form method="get" action="<?php 
        echo $admin->url;
        ?>
">
                <?php 
        echo I18n::lang('common', 'search', 'Search');
        ?>
                <?php 
        echo $search->form();
        ?>
                <?php 
        echo $select->form();
        echo $select_order->form();
        ?>
                <input type="submit" value="<?php 
        echo I18n::lang('common', 'search', 'Search');
        ?>
" />
                <input type="reset" value="<?php 
        echo I18n::lang('common', 'reset', 'Reset');
        ?>
" onclick="javascript:location.href='<?php 
        echo $admin->url;
        ?>
';"/>
            </form>
        </div>
        <?php 
    }
    if (!$admin->no_insert) {
        ?>
        <p><a href="<?php 
        echo Routes::add_get_parameters($admin->url, array('op_admin' => 1));
        ?>
"><?php 
        echo $admin->text_add_item;
        ?>
</a></p>
    <?php 
    }
    $admin->list->show();
}
コード例 #2
0
ファイル: parentlinks.php プロジェクト: phangoapp/phango
function ParentLinksView($arr_hierarchy, $url_fancy, $idfield, $arr_parameters = array(), $last_link = 0, $name_home = 'Principal')
{
    $arr_hierarchy[0]['name'] = $name_home;
    $arr_final = array();
    $c = count($arr_hierarchy) - 1;
    for ($x = 0; $x < $c; $x++) {
        $arr_id =& $arr_hierarchy[$x];
        $arr_tmp_param = $arr_parameters;
        $arr_tmp_param[$idfield] = $arr_id['id'];
        //$arr_tmp_param[]=slugify($arr_id['name']);
        $arr_final[$x] = '<a href="' . Routes::add_get_parameters($url_fancy, $arr_tmp_param) . '">' . $arr_id['name'] . '</a>';
    }
    switch ($last_link) {
        default:
            $arr_final[$x] = $arr_hierarchy[$x]['name'];
            break;
        case 1:
            $arr_tmp_param = $arr_parameters;
            $arr_tmp_param[$idfield] = $arr_hierarchy[$x]['id'];
            $arr_tmp_param[] = Utils::slugify($arr_hierarchy[$x]['name']);
            $arr_final[$x] = '<a href="' . Routes::add_get_parameters($url_fancy, $arr_tmp_param) . '">' . $arr_hierarchy[$x]['name'] . '</a>';
            break;
    }
    echo '<p>' . implode(' &gt; ', $arr_final);
}
コード例 #3
0
ファイル: controller_index.php プロジェクト: phangoapp/lang
 public function home($lang)
 {
     if (in_array($lang, I18n::$arr_i18n)) {
         $_SESSION['language'] = $lang;
         if ($_SERVER['HTTP_REFERER'] == '') {
             $_SERVER['HTTP_REFERER'] = Routes::$root_url;
         }
         if (preg_match('/\\/lang\\//', $_SERVER['HTTP_REFERER'])) {
             $_SERVER['HTTP_REFERER'] = Routes::$root_url;
         }
         Routes::redirect($_SERVER['HTTP_REFERER']);
     }
 }
コード例 #4
0
ファイル: menuhierarchy.php プロジェクト: phangoapp/phango
function menuhierarchy($name, $arr_elements, $element_id, $result, $z, $separator, $children = '')
{
    if (isset($arr_elements[$element_id])) {
        foreach ($arr_elements[$element_id] as $element) {
            //$arr_result[]=$element[1];
            //$result.='<li>'.$element[0]."\n";
            $result .= '<a href="' . Routes::make_simple_url('shop/viewcategory', [$element[1]]) . '" id="element_menu_' . $name . $z . '" class="menu_father ' . $children . '">' . $separator . '<i class="fa fa-arrow-circle-right"></i> ' . $element[0];
            if (isset($arr_elements[$element[1]])) {
                $result .= ' <i id="mail_plus" class="fa fa-angle-down"></i></a>';
                $result .= '<div id="element_menu_' . $name . $z . '_son" class="submenu">';
                $separator .= '&nbsp;&nbsp;';
                $result = menuhierarchy($name, $arr_elements, $element[1], $result, $z + 1, $separator, 'son_menu');
                $result .= '</div>';
            } else {
                $result .= '</a>';
            }
            //$result.='</li>'."\n";
        }
    }
    return $result;
}
コード例 #5
0
ファイル: LoginClass.php プロジェクト: phangoapp/phalibs
 /**
  * Method for recovery the password using a token. The data is obtain from $_GET['token_recovery']
  */
 public function recovery_password()
 {
     settype($_GET['token_recovery'], 'string');
     $_GET['token_recovery'] = trim($this->model_login->check_where_sql($this->field_recovery, $_GET['token_recovery']));
     if ($_GET['token_recovery'] == '') {
         settype($_POST['email'], 'string');
         $email = Utils::form_text($_POST['email']);
         $this->model_login->set_conditions('where ' . $this->field_mail . '="' . $email . '"');
         $this->model_login->reset_conditions = false;
         $query = $this->model_login->select(array($this->model_login->idmodel, $this->field_name, $this->field_mail));
         $this->model_login->reset_conditions = true;
         list($iduser_recovery, $nick, $email) = $this->model_login->fetch_row($query);
         settype($iduser_recovery, 'integer');
         if ($iduser_recovery > 0) {
             $email = @Utils::form_text($_POST['email']);
             $query = $this->model_login->select(array($this->model_login->idmodel, $this->field_name, $this->field_mail));
             list($iduser_recovery, $nick, $email) = $this->model_login->fetch_row($query);
             settype($iduser_recovery, 'integer');
             //Create token recovery...
             $token_recovery = hash($this->method_crypt, Utils::get_token());
             $this->model_login->reset_require();
             $this->model_login->set_conditions('where ' . $this->model_login->idmodel . '=' . $iduser_recovery);
             $query = $this->model_login->update(array($this->field_recovery => $token_recovery));
             //$query=$model['recovery_password']->insert(array('iduser' => $iduser_recovery, 'token_recovery' => sha1($token_recovery), 'date_token' => TODAY) );
             //Send email
             $url_check_token = Routes::add_get_parameters($this->url_recovery_send, array('token_recovery' => $token_recovery));
             $topic_email = I18n::lang('users', 'lost_name', 'You requested a new password');
             $body_email = I18n::lang('users', 'hello_lost_pass', 'Hello, you have requested a new password.') . "\n\n" . I18n::lang('users', 'explain_code_pass', 'You have requested a new password. Copy and paste the following url into your browser, and a new password will be generated for you. If you did not request this operation, ignore this message.') . "\n\n" . I18n::lang('users', 'copy_paste_code', 'Copy and paste the following url') . ': ' . $url_check_token . "\n\n" . I18n::lang('common', 'thanks', 'Thanks');
             if (Emailer::send_mail($this->sender, $email, $topic_email, $body_email)) {
                 echo '<p>' . I18n::lang('users', 'explain_email_code_pass', 'You have requested a new password. Copy and paste the following url into your browser, and a new password will be generated for you. If you did not request this operation, ignore this message.') . '</p>';
             } else {
                 echo '<p>' . I18n::lang('users', 'cannot_email_code_pass', 'We can not send to your email the instructions to change your password. Please contact the administrator of this site to solve the problem.') . '</p>';
             }
         } else {
             echo "<p>" . I18n::lang('users', 'error_db_pass', 'Error, mail format is wrong') . '</p>';
             echo "<p><a href=\"" . $this->url_recovery . "\"><b>" . I18n::lang('common', 'go_back', 'Go back') . "</b></a></p>";
         }
     } else {
         $this->model_login->set_conditions('where ' . $this->field_recovery . '="' . $_GET['token_recovery'] . '"');
         $query = $this->model_login->select(array($this->model_login->idmodel, $this->field_name, $this->field_mail));
         list($iduser_recovery, $nick, $email) = $this->model_login->fetch_row($query);
         settype($iduser_recovery, 'integer');
         if ($iduser_recovery > 0) {
             $password = Utils::generate_random_password();
             $topic_email = I18n::lang('users', 'success_change_password', 'The password was changed successfully.');
             $body_email = I18n::lang('users', 'hello_lost_pass_successful', 'Hello, we have changed your password and is shown below. With these data should be back online in the system.') . "\n\n" . I18n::lang('users', 'user_data', 'User\'s data') . "\n\n" . I18n::lang('users', 'user', 'User') . " : {$nick}" . "\n\n" . I18n::lang('common', 'email', 'Email') . " : {$email}" . "\n\n" . I18n::lang('users', 'new_pass', 'New password') . " : {$password}" . "\n\n" . I18n::lang('common', 'thanks', 'Thanks');
             if ($email !== "") {
                 //$query=$model['recovery_password']->delete('where '.$this->model_login->idmodel.'='.$iduser_recovery);
                 $this->model_login->reset_require();
                 $query = $this->model_login->update(array($this->field_password => $password, $this->field_recovery => ''), 'where ' . $this->model_login->idmodel . '=' . $iduser_recovery);
                 if (Emailer::send_mail($this->sender, $email, $topic_email, $body_email)) {
                     echo "<p>" . I18n::lang('users', 'success_change_password', 'The password was changed successfully.') . '</p>';
                     echo "<p>" . I18n::lang('users', 'success_change_password_explain', 'We have sended to your email, the new password.') . '</p>';
                 } else {
                     echo "<p>" . I18n::lang('users', 'success_change_password', 'The password was changed successfully.') . '</p>';
                     echo "<p>" . I18n::lang('users', 'error_sending_mail_change_password', 'We can not send your new password to your email at this time, we are showing your user data in plain text. For added security, change your password once achieved identified in the system again.') . '</p>';
                     echo '<pre>';
                     echo $body_email;
                     echo '</pre>';
                 }
             } else {
                 echo "<p>" . I18n::lang('users', 'error_db_pass', 'Error, mail format is wrong') . '</p>';
             }
         } else {
             echo "<p>" . I18n::lang('users', 'error_token_pass', 'Error: incorrect code used to change a password.') . '</p>';
         }
         echo "<p><a href=\"" . $this->url_login . "</b></a></p>";
     }
 }
コード例 #6
0
ファイル: config_routes.php プロジェクト: phangoapp/phango
<?php

use PhangoApp\PhaRouter\Routes;
Routes::$root_url = '/';
Routes::$app = 'phangoapp/welcome';
Routes::$apps = ['welcome'];
Routes::$base_path = getcwd();
Routes::$root_path = Routes::$root_path . '/vendor';
コード例 #7
0
ファイル: AdminUtils.php プロジェクト: phangoapp/phalibs
 /**
  * A simple method for create urls for use in admin
  *
  * With this method you can create easily urls for your admin site
  *
  * @param string $text_admin The module to admin
  * @param array $parameters An array with format key value used for set get values in the new url
  */
 public static function set_admin_link($text_admin, $parameters = array())
 {
     #return Routes::make_module_url(ADMIN_FOLDER, 'index', 'home', array($text_admin), $get=$parameters);
     return Routes::make_simple_url(ADMIN_FOLDER, array($text_admin), $parameters);
 }
コード例 #8
0
ファイル: console.php プロジェクト: phangoapp/phango
<?php

//Loading libraries with includes, don't need more sofisticated methods...
ini_set('html_errors', 0);
require __DIR__ . "/vendor/autoload.php";
use PhangoApp\PhaRouter\Routes;
use PhangoApp\PhaUtils\Utils;
use PhangoApp\PhaView\View;
use PhangoApp\PhaI18n\I18n;
Routes::$base_path = __DIR__;
chdir(Routes::$base_path);
Utils::load_config('config_routes');
Utils::load_config('config_i18n');
Utils::load_config('config');
Utils::load_config('config_views');
/**Load configurations from modules**/
foreach (Routes::$apps as $admin_module) {
    Utils::load_config('config', $path = 'vendor/' . $admin_module . "/settings");
}
/*
include('libraries/fields/corefields.php');
include('libraries/forms/coreforms.php');
*/
I18n::load_lang('common');
//Load extra libraries
/*Utils::load_libraries(array('fields/corefields'));
Utils::load_libraries(array('forms/coreforms'));*/
//date_default_timezone_set (MY_TIMEZONE);
$utility_console = 1;
//load_lang('common', 'user');
$model = array();
コード例 #9
0
ファイル: config.php プロジェクト: paramecio/pastafari_old
<?php

use PhangoApp\PhaModels\Webmodel;
use PhangoApp\PhaRouter\Routes;
Routes::$root_url = '/';
Routes::$app = 'chorizon/pastafari';
Routes::$apps = ['chorizon/pastafari'];
/**
* Configure database. You can configure multiple databases for different models.
*/
Webmodel::$host_db['default'] = 'localhost';
Webmodel::$db['default'] = 'default';
Webmodel::$login_db['default'] = 'root';
Webmodel::$pass_db['default'] = '';
define('ADMIN_FOLDER', 'admin');
# Secret key of this server
define('SECRET_KEY', 'secret_key');
define('SECRET_KEY_HASHED_WITH_PASS', 'the_pass');
コード例 #10
0
ファイル: index.php プロジェクト: phangoapp/phango
<?php

use PhangoApp\PhaRouter\Routes;
use PhangoApp\PhaUtils\Utils;
use PhangoApp\PhaView\View;
use PhangoApp\PhaI18n\I18n;
include __DIR__ . "/vendor/autoload.php";
if (!defined('COOKIE_SESSION_NAME')) {
    define('COOKIE_SESSION_NAME', 'phango');
}
$route = new Routes();
$route->arr_finish_callbacks = array('PhangoApp\\PhaModels\\Webmodel::save_cache_query' => []);
Utils::load_config('config_i18n');
Utils::load_config('config');
Utils::load_config('config_views');
session_name(COOKIE_SESSION_NAME . '_session');
session_set_cookie_params(0, Routes::$root_url);
session_start();
I18n::load_lang('common');
/**Load configurations from modules**/
foreach (Routes::$apps as $admin_module) {
    Utils::load_config('config', $path = 'vendor/' . $admin_module . "/settings");
}
date_default_timezone_set(PhangoApp\PhaTime\DateTime::$timezone);
$route->response($_SERVER['REQUEST_URI']);
コード例 #11
0
 public function show_config()
 {
     settype($_GET['op_admin'], 'integer');
     $action = Routes::add_get_parameters($this->url, array('op_admin' => 1));
     switch ($_GET['op_admin']) {
         default:
             $post = $this->model->select_a_row_where($this->arr_fields_edit, true);
             $this->form($post, $action);
             break;
         case 1:
             $c = $this->model->select_count();
             if ($c > 0) {
                 $post = $this->model->select_a_row_where([$this->model->idmodel], true);
                 $_GET[$this->model->idmodel] = $post[$this->model->idmodel];
                 $this->update_model($action);
             } else {
                 $this->insert_model($action);
             }
             break;
     }
 }
コード例 #12
0
ファイル: controller_index.php プロジェクト: phangoapp/admin
 public function home($module_id = 'none', $submodule_id = '')
 {
     if ($submodule_id != '') {
         $module_id = basename(Utils::slugify($module_id)) . '/' . basename(Utils::slugify($submodule_id));
     }
     class_alias('indexController', 'AdminSwitchClass');
     AdminSwitchClass::$login = new LoginClass(Webmodel::$model['user_admin'], 'user_admin', 'password', '', $arr_user_session = array('IdUser_admin', 'privileges_user', 'username', 'token_client', 'lang'), $arr_user_insert = array('user_admin', 'password', 'repeat_password', 'email'));
     AdminSwitchClass::$login->field_key = 'token_client';
     ob_start();
     //global $model, $lang, PhangoVar::$base_url, PhangoVar::$base_path, $user_data, $arr_module_admin, $config_data, $arr_block, $original_theme, $module_admin, $header;
     $header = '';
     $content = '';
     //load_libraries(array('utilities/set_admin_link'));
     //settype($module_id, 'string');
     $module_id = Utils::slugify($module_id, 1);
     $extra_urls = array();
     //Make menu...
     //Admin was internationalized
     if (AdminSwitchClass::$login->check_login()) {
         LoginClass::$session['user_admin']['token_client'] = sha1(LoginClass::$session['user_admin']['token_client']);
         if (!isset($_SESSION['language'])) {
             $_SESSION['language'] = LoginClass::$session['user_admin']['lang'];
         }
         I18n::load_lang('phangoapp/admin');
         Utils::load_config('config_admin', 'settings/admin');
         //variables for define titles for admin page
         $arr_son_module = array();
         $title_admin = I18n::lang('phangoapp/admin', 'admin', 'Admin');
         $title_module = I18n::lang('phangoapp/admin', 'home', 'Home');
         $content = '';
         $name_modules = array();
         $no_show_menu = [];
         $urls = array();
         $arr_permissions_admin = array();
         $arr_permissions_admin['none'] = 1;
         $module_admin = array();
         $arr_admin_script['none'] = AdminUtils::$admin_controller;
         //Define $module_admin[$module_id] for check if exists in database the module
         $module_admin[$module_id] = 'AdminIndex';
         //I18n::$lang[$module_admin[$module_id].'_admin']['AdminIndex_admin_name']=ucfirst(I18n::lang('phangoapp/admin', 'admin', 'Admin'));
         //0=> name in uri, 1 => route to script, 2 name of script
         $title_admin = AdminUtils::$name_admin;
         foreach (ModuleAdmin::$arr_modules_admin as $ser_admin_script) {
             //load little file lang with the name for admin. With this you don't need bloated with biggest files of langs...
             $idmodule = $ser_admin_script[0];
             $name_module = $idmodule;
             if (gettype($ser_admin_script[1]) == 'string') {
                 $name_modules[$name_module] = $ser_admin_script[2];
                 $arr_admin_script[$idmodule] = $ser_admin_script;
                 $urls[$name_module] = AdminUtils::set_admin_link($idmodule, array());
                 $module_admin[$idmodule] = $name_module;
                 $arr_permissions_admin[$idmodule] = 1;
                 if (isset($ser_admin_script[3])) {
                     $no_show_menu[$name_module] = 1;
                 }
             } else {
                 $name_modules[$name_module] = $ser_admin_script[2];
                 //unset(ModuleAdmin::$arr_modules_admin[$idmodule]['title']);
                 foreach ($ser_admin_script[1] as $ser_admin_script_son) {
                     $idmodule_son = $ser_admin_script_son[0];
                     $name_module_son = $idmodule_son;
                     $name_modules[$name_module_son] = $ser_admin_script_son[2];
                     $arr_admin_script[$idmodule_son] = $ser_admin_script_son;
                     $urls[$name_module_son] = AdminUtils::set_admin_link($idmodule_son, array());
                     $module_admin[$idmodule_son] = $name_module_son;
                     $arr_permissions_admin[$idmodule_son] = 1;
                     if (isset($ser_admin_script_son[3])) {
                         $no_show_menu[$name_module_son] = 1;
                     }
                 }
             }
         }
         if (!isset($arr_admin_script[$module_id])) {
             //Need show error.
             $this->route->response404();
             die;
         }
         //$file_include=Routes::$base_path.'/vendor/'.$arr_admin_script[ $module_id ][1].'/controllers/admin/admin_'.basename($arr_admin_script[ $module_id ][0]).'.php';
         $file_include = Routes::$base_path . '/' . $arr_admin_script[$module_id][1] . '.php';
         if (LoginClass::$session['user_admin']['privileges_user'] == 1) {
             $arr_permissions_admin = array();
             $arr_module_saved = array();
             $arr_module_strip = array();
             $arr_permissions_admin[$module_id] = 0;
             $arr_permissions_admin['none'] = 1;
             Webmodel::$model['moderators_module']->set_conditions(['where moderator=?', [$_SESSION['IdUser_admin']]]);
             $query = Webmodel::$model['moderators_module']->select(array('idmodule'), 1);
             while (list($idmodule_mod) = Webmodel::$model['moderators_module']->fetch_row($query)) {
                 //settype($idmodule_mod, 'integer');
                 $arr_permissions_admin[$idmodule_mod] = 1;
                 $arr_module_saved[] = $module_admin[$idmodule_mod];
             }
             $arr_module_strip = array_diff(array_keys($name_modules), $arr_module_saved);
             foreach ($arr_module_strip as $name_module_strip) {
                 unset($name_modules[$name_module_strip]);
                 unset($urls[$name_module_strip]);
             }
         }
         if (file_exists($file_include) && $module_admin[$module_id] != '' && $arr_permissions_admin[$module_id] == 1) {
             include $file_include;
             $func_admin = basename($module_admin[$module_id]) . 'Admin';
             if ($module_id != 'none') {
                 $title_admin = $name_modules[$module_id];
             }
             if (function_exists($func_admin)) {
                 $extra_data = $func_admin();
                 settype($extra_data, 'array');
                 $extra_data = array_merge($extra_data, $arr_son_module);
             } else {
                 throw new Exception('Error: no exists function ' . ucfirst($func_admin) . ' for admin application');
             }
         } else {
             if ($module_admin[$module_id] != '' && $arr_permissions_admin[$module_id] == 1) {
                 $output = ob_get_contents();
                 ob_clean();
                 throw new Exception('Error: no exists file ' . $file_include . ' for admin application');
                 die;
             } else {
                 $this->route->response404();
                 die;
             }
         }
         $content = ob_get_contents();
         ob_end_clean();
         if (AdminUtils::$show_admin_view == true) {
             $content = '<h1>' . $title_admin . "</h1>\n" . $content;
             echo View::load_view(array('header' => $header, 'title' => I18n::lang('phangoapp/admin', 'admin_zone', 'Admin zone'), 'content' => $content, 'name_modules' => $name_modules, 'urls' => $urls, 'extra_data' => $extra_data, 'no_show_menu' => $no_show_menu), 'admin/admin');
         } else {
             echo $content;
         }
     } else {
         $url = Routes::make_simple_url(ADMIN_FOLDER . '/login');
         die(header('Location: ' . $url, true));
     }
 }
コード例 #13
0
ファイル: admin.php プロジェクト: phangoapp/admin
function AdminView($header, $title, $content, $name_modules, $url_modules, $extra_data, $no_show_menu)
{
    View::$js[] = 'jquery.min.js';
    View::$css[] = 'font-awesome.min.css';
    View::$js_module['admin'][] = 'responsive-nav.min.js';
    View::$css_module['admin'][] = 'admin.css';
    View::$css_module['admin'][] = 'responsive-nav.css';
    ?>
    <!DOCTYPE html>
    <html>
    <head>                                                                                          
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
    <title><?php 
    echo $title;
    ?>
</title>
    <?php 
    echo View::load_css();
    ?>
    <?php 
    echo View::load_js();
    ?>
    <?php 
    echo View::load_header();
    ?>
 
    </head>
    <body>
    <div id="logout">
    <a href="<?php 
    echo AdminUtils::set_admin_link('login/logout');
    ?>
"><i class="fa fa-power-off" aria-hidden="true"></i> Logout</a>
    </div>

    <div id="center_body">
        <div id="header">
            <a href="#nav" id="toggle"><i class="fa fa-bars" aria-hidden="true"></i><span>Menu</span></a>
            <span id="title_phango">Phango</span> <span id="title_framework">Framework!</span> 
            <div id="languages_general">
            <?php 
    $arr_selected = array();
    foreach (I18n::$arr_i18n as $lang_item) {
        //set
        $arr_selected[Utils::slugify($lang_item)] = 'no_choose_flag_general';
        $arr_selected[Utils::slugify(I18n::$language)] = 'choose_flag_general';
        ?>
                <a class="<?php 
        echo $arr_selected[Utils::slugify($lang_item)];
        ?>
" href="<?php 
        echo Routes::make_module_url('lang', 'index', 'home', array('language' => $lang_item));
        ?>
"><img src="<?php 
        echo View::get_media_url('images/languages/' . $lang_item . '.png');
        ?>
" alt="<?php 
        echo $lang_item;
        ?>
"/></a> 
                <?php 
    }
    ?>
            </div>
        </div>
        <div class="content_admin">
            <nav id="menu" class="nav-collapse">
                <ul>
                    <li class="menu_title"><i class="fa fa-gear" aria-hidden="true"></i> <?php 
    echo I18n::lang('phangoapp/admin', 'applications', 'Applications');
    ?>
</li>
                    <?php 
    foreach ($name_modules as $key_module => $name_module) {
        if (!isset($no_show_menu[$key_module])) {
            if (isset($url_modules[$key_module])) {
                ?>
                            <li><a href="<?php 
                echo $url_modules[$key_module];
                ?>
"><i class="fa fa-circle-o" aria-hidden="true"></i> <?php 
                echo $name_module;
                ?>
</a></li>
                            <?php 
            } else {
                echo '<li><div class="father_admin">' . $name_module . '</div></li>';
            }
        }
        //If have $key_module with an extra_url element from extra_data, put here.
        if (isset($extra_data['extra_url'][$key_module])) {
            foreach ($extra_data['extra_url'][$key_module]['url_module'] as $key => $url_module) {
                ?>
								<li><a class="sub_module" href="<?php 
                echo $url_module;
                ?>
">&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-circle-o" aria-hidden="true"></i> <?php 
                echo ucfirst($extra_data['extra_url'][$key_module]['name_module'][$key]);
                ?>
</a></li>
								<?php 
            }
        }
    }
    ?>
                </ul>
            </nav>
            <div class="contents">
                    <?php 
    echo View::show_flash();
    ?>
					<?php 
    echo $content;
    ?>
            </nav>
        </div>
    </div>
    <div id="loading_ajax">
    </div>
    <script>
        var navigation = responsiveNav(".nav-collapse", {customToggle: "#toggle"});
    </script>
    </body>
    </html>

    <?php 
}
コード例 #14
0
ファイル: controller_login.php プロジェクト: phangoapp/admin
 public function logout()
 {
     ob_start();
     $this->login->logout();
     $cont_index = ob_get_contents();
     ob_end_clean();
     Routes::redirect(Routes::make_simple_url(ADMIN_FOLDER . '/login'));
 }
コード例 #15
0
ファイル: SimpleList.php プロジェクト: phangoapp/phalibs
 public static function NoDeleteOptionsListModel($url_options, $model_name, $id)
 {
     $url_options_edit = Routes::add_get_parameters($url_options, array('op_admin' => 2, Webmodel::$model[$model_name]->idmodel => $id));
     $arr_options = array('<a href="' . $url_options_edit . '">' . I18n::lang('common', 'edit', 'Edit') . '</a>');
     return $arr_options;
 }