Ejemplo n.º 1
0
 public function get_menus($access = null)
 {
     if (!is_array($access)) {
         $access[0] = 0;
         /* everyone */
     }
     $menus = [];
     if ($access != NULL) {
         $key = $this->cache_prefix . '_' . o::filesafe(ci()->user->role_name);
         if (!($cache = ci()->cache->get($key))) {
             $cache = [];
             $results = $this->order_by('sort')->get_many_by('active', 1);
             foreach ((array) $results as $row) {
                 $cache[$row->id] = $row;
             }
             ci()->cache->save($key, $cache);
         }
         /* does the user have access to this menu? */
         foreach ($cache as $id => $rec) {
             /* access is the complete array */
             if (in_array($rec->access_id, $access)) {
                 $menus[$rec->id] = $rec;
             }
         }
     }
     return $menus;
 }
Ejemplo n.º 2
0
 function index()
 {
     //_cfg::$fileIni = 'magé';
     echo o::pt(_cfg::this());
     //_cfg::saveConfig(RPATH.'teste.ini');
     _view::set('inicial');
 }
Ejemplo n.º 3
0
 public static function show($name, $value, $options, $extra = [])
 {
     $defaults = ['name' => $name, 'autocomplete' => 'off', 'style' => '', 'id' => $name, 'class' => '', 'empty' => FALSE, 'key_value' => 'id', 'value_value' => 'name'];
     $list = array_merge($defaults, (array) $extra);
     $list['class'] .= ' o_combobox';
     $options[$value] = $value;
     echo o::element_rtn('select', $list);
     echo o::dropdown_options($value, $options, $list);
     echo '</select>';
 }
Ejemplo n.º 4
0
 public static function confirm_a($href = '', $title = 'Are you sure?', $extra = [])
 {
     if (is_array($href)) {
         $href['class'] .= ' js-o_dialog';
         $href['href'] = $href['href'] ? $href['href'] : '#';
         echo '<a ' . o::convert2attributes($href) . '>';
     } else {
         $defaults = ['icon' => 'exclamation-triangle'];
         $extra = array_merge($defaults, $extra);
         $extra['heading'] = $title;
         $class = $extra['class'];
         unset($extra['class']);
         echo '<a href="' . $href . '" class="js-o_dialog ' . $class . '" ' . o::convert2data($extra) . '>';
     }
 }
Ejemplo n.º 5
0
theme::table_tabs($records['records'], ['human' => true]);
theme::table_tabs_start();
asort($records['records']);
foreach ($records['records'] as $tab => $tab_records) {
    theme::table_tab_pane_start($tab);
    theme::table_start(['Name', 'Description', 'Key', 'Actions' => 'text-center']);
    uasort($tab_records, function ($a, $b) {
        return $a->name > $b->name ? 1 : -1;
    });
    foreach ($tab_records as $record) {
        theme::table_start_tr();
        o::e($record->name);
        theme::table_row();
        o::e($record->description);
        theme::table_row();
        o::e($record->key);
        theme::table_row('actions text-center');
        if ($record->is_editable) {
            theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
        }
        if ($record->is_deletable) {
            o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
        }
        theme::table_action('list-ul', $this->controller_path . '/details/' . $record->id);
        theme::table_end_tr();
    }
    theme::table_end();
    theme::table_tab_pane_end();
}
theme::table_tabs_end();
theme::return_to_top();
Ejemplo n.º 6
0
    echo $errors . '<br>';
    echo 'This needs to be fixed in order for packages to be dynamically loaded.';
    echo '</div>';
}
theme::table_start(['Name', 'Type' => 'text-center', 'Description', 'Version' => 'text-center', 'Actions' => 'text-center'], [], $records);
//k($records);
foreach ($records as $name => $record) {
    /* Name */
    theme::table_start_tr();
    o::html($record['www_name']);
    /* type */
    theme::table_row('text-center');
    echo '<span class="label label-' . $type_map[$record['composer']['orange']['type']] . '">' . $record['composer']['orange']['type'] . '</span>';
    /* Description */
    theme::table_row();
    o::e($record['composer']['description']);
    echo ' <a href="' . $controller_path . '/details/' . $record['url_name'] . '"><i class="text-info fa fa-info-circle"></i></a> ';
    /* Version */
    theme::table_row('text-center');
    /* show upgrade version and up arrow? */
    if ($record['composer']['orange']['version'] == $record['database']['migration_version']) {
        echo '<span class="label label-primary">' . $record['database']['migration_version'] . '</span>';
    } else {
        echo '<span class="label label-info">' . $record['composer']['orange']['version'] . '</span>&nbsp;';
        echo '<span class="label label-primary">' . $record['database']['migration_version'] . '</span>';
    }
    /* Actions */
    theme::table_row('text-center');
    echo '<nobr>';
    /* show install */
    if ($record['buttons']['error']) {
Ejemplo n.º 7
0
 public static function footer_button($href, $text, $extra = [], $type = 'button')
 {
     $defaults = ['class' => 'btn btn-default js-' . o::websafe($text), 'href' => $href];
     $list = array_merge($defaults, (array) $extra);
     echo '&nbsp;&nbsp;&nbsp;';
     echo o::element_rtn($type, $list, $text);
 }
Ejemplo n.º 8
0
<?php

theme::header_start('Manage Order Statues');
theme::header_button_new();
theme::header_end();
theme::table_start(['Name', 'On New' => 'txt-ac', 'On Update' => 'txt-ac', 'Cancel' => 'txt-ac', 'Actions' => 'txt-ac'], null, $records);
foreach ($records as $record) {
    $record->id = $record->ord_status_id;
    theme::table_start_tr();
    o::e($record->ord_status_description);
    theme::table_row('txt-ac larger');
    theme::enum_icon($record->ord_status_save_default);
    theme::table_row('txt-ac larger');
    theme::enum_icon($record->ord_status_resave_default);
    theme::table_row('txt-ac larger');
    theme::enum_icon($record->ord_status_cancelled);
    theme::table_row('actions txt-ac');
    theme::table_action('edit', $this->controller_path . '/edit/' . $record->ord_status_id);
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->ord_status_id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
Ejemplo n.º 9
0
</div>
<?php 
echo form_open('/orange/login', ['data-validate' => 'true']);
?>
<div class="login-background">
	<div class="login-area">
			<h2>Welcome</h2>
			<p>Let's get started!</p>
			<div class="email">
				<i class="fa fa-envelope"></i> <input type="text" id="email" name="email" value="" placeholder="email">
			</div>
			<div class="password">
				<i class="fa fa-key"></i> <input type="password" id="password" name="password" value="" placeholder="password">
			</div>
			<button type="submit" id="submit-button" class="btn-login">Login</button>
		<div class="extra">
			<?php 
o::view_event($controller_path, 'login');
?>
			<a href="/">Back to Home Page</a>
		</div>
	</div>
</div>
</form>
<div>
Ejemplo n.º 10
0
<?php

theme::header_start('Menubar', 'manage menubars using the list view.');
Plugin_search_sort::field();
theme::header_button('Back', $controller_path, 'reply');
theme::header_end();
theme::table_start(['Text', 'URL', 'Access', 'Parent', 'Active' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    o::e($record->text);
    theme::table_row();
    o::e($record->url);
    theme::table_row();
    o::smart_model('o_access', $record->access_id, 'key');
    theme::table_row();
    o::smart_model('o_menubar', $record->parent_id, 'text');
    theme::table_row('text-center larger');
    theme::enum_icon($record->active);
    theme::table_row('actions text-center');
    if ($record->is_editable) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if (has_access('orange::advanced menubar')) {
        theme::table_action('pencil-square', $this->controller_path . '/edit/' . $record->id . '/advanced');
    }
    if ($record->is_deletable) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    }
    theme::table_end_tr();
}
theme::table_end();
Ejemplo n.º 11
0
</td>
			</tr>
		</table>
	</div>
</div>


<div class="panel panel-default">
	<div class="panel-heading">
		<h3 class="panel-title">Roles with this Access</h3>
	</div>
	<div class="panel-body" style="padding:0">
		<table class="table" style="margin:0">
				<tr>
					<td title="1"><a href="/admin/users/role/details/1"><?php 
o::smart_model('o_role', 1, 'name');
?>
</a></td>
				</tr>

				<?php 
foreach ($roles as $key => $record) {
    ?>
				<tr>
					<td title="<?php 
    echo $record->id;
    ?>
"><a href="/admin/users/role/details/<?php 
    echo $record->id;
    ?>
"><?php 
Ejemplo n.º 12
0
<?php

theme::header_start('Users', 'manage users');
Plugin_search_sort::field();
theme::header_button_new();
theme::header_end();
theme::table_start(['Name', 'Email', 'Role', 'Active' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    o::e($record->username);
    theme::table_row();
    o::e($record->email);
    theme::table_row();
    echo '<a href="/admin/users/role/details/' . $record->role_id . '">';
    o::smart_model('o_role', $record->role_id, 'name');
    echo '</a>';
    theme::table_row('text-center larger');
    theme::enum_icon($record->is_active);
    theme::table_row('actions text-center');
    if ($record->is_editable) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if ($record->is_deletable) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    }
    theme::table_action('list-ul', $this->controller_path . '/details/' . $record->id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
Ejemplo n.º 13
0
    function index()
    {
        //Setando os recursos listados.
        //TODO: fazer configurador na página para setar os recursos pelo próprio usuário (criar/editar/apagar).
        $recursos = array('file1');
        $msg = '';
        //Checando se o comando "run" foi solicitado
        if (!isset($_POST['run'])) {
            //criando as variáveis iniciais
            foreach ($recursos as $v) {
                $dt[$v] = array('o' => RPATH, 'd' => RPATH . $v . '.phar', 'i' => 'index.php', 'r' => 'checked', 'z' => 'checked');
            }
        } else {
            o::pt($_POST);
            //RODANDO o conversor
            include LIB . 'makephar.php';
            //formatando os dados que vieram do post
            foreach ($recursos as $v) {
                if (isset($_POST[$v])) {
                    $dt[$v] = $_POST[$v];
                }
            }
            //rodando
            $phar = makePhar($dt);
            //mensagem de sucesso
            $msg = '<p class="success msg xmsg">';
            if (!is_array($phar)) {
                $msg .= 'Dados insuficientes para a conversão - <b>nenhuma</b> conversão foi realizada!';
            } else {
                foreach ($phar as $k => $v) {
                    if (isset($v['e'])) {
                        $msg = $v['e'] . '<br>';
                    } elseif (isset($v['d'])) {
                        $msg .= $v['d'] . ' -- <b>Ok</b>!<br>';
                    } else {
                        $msg .= 'Erro desconhecido em "<b>' . $k . '</b>"';
                    }
                }
            }
            $msg .= '</p>';
        }
        //habilitando o botão "Run"
        $executar = true;
        //verificando a verão do PHP
        if (version_compare(PHP_VERSION, '5.3.0', '<')) {
            $msg .= '<p class="error msg"><b>Versão do PHP incompatível!</b> - sua versão: ' . phpversion() . ' -- versão requerida: 5.3.0 (ou mais).</p>';
            $executar = false;
        }
        //checando phar.readonly
        if (function_exists('ini_get')) {
            if (ini_get('phar.readonly') != '' || ini_get('phar.readonly') == 'On') {
                $msg .= '<p class="error msg">A diretiva <b>"phar.readonly"</b> no arquivo "php.ini" deve ser " = <b>Off</b>"</p>';
                $executar = false;
            }
        } else {
            $msg .= '<p class="error msg"><b>A diretiva "phar.readonly" no arquivo "php.ini" não pode ser checada</b>.<br >
			O valor deve ser <b>" = Off "</b> para usar arquivos PHAR.<br /><b class="red">A conversão pode não funcionar!</b></p>';
        }
        //Habilitando o botão "RUN"
        $noRun = !$executar ? 'disabled title="Não é possível converter sem solucionar o problema indicado acima!"' : 'title="Executar a conversão em PHAR!"';
        //Criando as colunas da tabela de configuração
        $table = '';
        foreach ($dt as $k => $v) {
            $table .= '
				<tr>                   
					<td><input name="' . $k . '[o]" type="text" value="' . $v['o'] . '"></td>
					<td><input name="' . $k . '[d]" type="text" value="' . $v['d'] . '"></td>
					<td><input name="' . $k . '[i]" type="text" value="' . $v['i'] . '"></td>
					<td title="Compactar o arquivo: On/Off"><input name="' . $k . '[z]" type="checkbox" value="checked" ' . @$v['z'] . '></td>
					<td><input name="del" class="bt_del" type="button" value="" title="Excluir este recurso." /></td>					
				</tr>';
        }
        //<td title="Converter em PHAR: On/Off"><input name="'.$k.'[r]" type="checkbox" value="checked" '.@$v['r'].'></td>
        _view::val('msg', $msg);
        _view::val('table', $table);
        _view::val('noRun', $noRun);
        _view::set('inicial');
    }
Ejemplo n.º 14
0
 /**
  * Pegando dados do Config
  */
 static function __callStatic($name, $var)
 {
     exit(\o::pt($name) . \o::pt($var));
 }
Ejemplo n.º 15
0
<?php

theme::header_start('Manage Zones');
theme::header_button_new();
theme::header_end();
theme::table_start(['Name', 'Description', 'Active' => 'txt-ac', 'Actions' => 'txt-ac'], null, $records);
foreach ($records as $record) {
    $record->id = $record->lzone_id;
    theme::table_start_tr();
    o::e($record->lzone_name);
    theme::table_row();
    o::shorten($record->lzone_description);
    theme::table_row('txt-ac larger');
    theme::enum_icon($record->lzone_status);
    theme::table_row('actions txt-ac');
    theme::table_action('edit', $this->controller_path . '/edit/' . $record->lzone_id);
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->lzone_id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
Ejemplo n.º 16
0
<?php

theme::form_start($controller_path . '/' . $controller_action, $record->id);
theme::header_start(ucfirst($controller_action) . ' ' . $controller_title);
theme::header_end();
o::hr(0, 12);
theme::start_form_section('Group', true, 3);
$sorted = o::smart_model_list('o_access_model', 'group', 'group');
asort($sorted);
plugin_combobox::show('group', $record->group, $sorted);
theme::end_form_section();
theme::start_form_section('Access', true, 3);
o::text('name', $record->name);
theme::end_form_section();
theme::start_form_section('Description', 6);
o::text('description', $record->description);
theme::end_form_section();
o::view_event($controller_path, 'form.footer');
o::hr(0, 12);
theme::footer_start();
theme::footer_cancel_button($controller_path);
theme::footer_submit_button();
theme::footer_required();
theme::footer_end();
theme::form_end();
Ejemplo n.º 17
0
<?php

/* on delete assigned to this role */
$role_name = o::smart_model('o_role_model', setting('auth', 'Default Role Id'), 'name', true);
theme::header_start('Roles', 'manage user roles.');
Plugin_search_sort::field();
theme::header_button_new();
theme::header_end();
theme::table_start(['Name', 'Description', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    o::e($record->name);
    theme::table_row();
    o::e($record->description);
    theme::table_row('actions text-center');
    if ($record->is_editable) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if ($record->is_deletable) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id, ['data' => ['append' => '<br>This will reassign all users with this role to the "' . $role_name . '" role.']]);
    }
    theme::table_action('list-ul', $this->controller_path . '/details/' . $record->id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
Ejemplo n.º 18
0
theme::header_button('Built in', $controller_path . '/list-all', 'file');
theme::header_end();
theme::table_empty($records['records']);
theme::table_tabs($records['records']);
theme::table_tabs_start();
foreach ($records['records'] as $tab => $tab_records) {
    theme::table_tab_pane_start($tab);
    theme::table_start(['Name', 'Value', 'Managed' => 'text-center', 'Actions' => 'text-center']);
    /* show them in the order they where entered */
    uasort($tab_records, function ($a, $b) {
        return $a->id > $b->id ? 1 : -1;
    });
    foreach ($tab_records as $record) {
        theme::table_start_tr();
        echo !$record->enabled ? '<i class="text-muted">' : '';
        o::e($record->name);
        echo !$record->enabled ? '</i>' : '';
        theme::table_row();
        echo theme::format_value($record->value, 128);
        theme::table_row('larger text-center');
        echo theme::enum_icon((int) $record->managed);
        theme::table_row('actions text-center');
        if ($record->is_editable) {
            theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
        }
        if (has_access('orange::advanced settings')) {
            theme::table_action('pencil-square', $this->controller_path . '/edit/' . $record->id . '/advanced');
        }
        if ($record->is_deletable) {
            o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
        }
Ejemplo n.º 19
0
 function index()
 {
     o::go('inicialize');
     _cfg::loadConfig('app');
     exit(o::pt(_cfg::this()));
 }
Ejemplo n.º 20
0
<br>
<div>
	<strong>URL: </strong><?php 
o::e(rtrim($record->url, '/#'));
?>
</div>
<br>
<div>
	<strong>Access: </strong><?php 
o::smart_model('o_access', $record->access_id, 'key');
?>
</div>
<br>
<div>
	<strong>Enabled: </strong><?php 
o::enum($record->active, 'Inactive|Active');
?>
</div>
<br>

<div>
<?php 
if ($record->is_deletable) {
    ?>
	<?php 
    o_dialog::confirm_a($controller_path . '/delete/' . $record->id, 'Delete Record', ['text' => 'Are you sure you want to delete this record?', 'icon' => 'trash', 'class' => 'btn btn-sm btn-danger', 'callback' => 'menubar_hander', 'id' => $record->id]);
    ?>
<i class="fa fa-trash"></i> Delete</a>
<?php 
}
?>
Ejemplo n.º 21
0
<?php

theme::header_start('Manage Currencies', 'Manage your stores currency.');
theme::header_button_new();
theme::header_end();
theme::table_start(['Name', 'Exchange Rate', 'Symbol' => 'text-center', 'Suffix' => 'text-center', 'Thousand' => 'text-center', 'Decimal' => 'text-center', 'Status' => 'text-center', 'Actions' => 'text-center'], null, $records);
foreach ($records as $record) {
    theme::table_start_tr();
    o::e($record->curr_name);
    theme::table_row();
    o::shorten($record->curr_exchange_rate);
    theme::table_row('text-center');
    o::shorten($record->curr_symbol);
    theme::table_row('text-center larger');
    theme::enum_icon($record->curr_symbol_suffix);
    theme::table_row('text-center');
    o::shorten($record->curr_thousand_separator);
    theme::table_row('text-center');
    o::shorten($record->curr_decimal_separator);
    theme::table_row('text-center larger');
    theme::enum_icon($record->curr_status);
    theme::table_row('actions text-center');
    theme::table_action('edit', $this->controller_path . '/edit/' . $record->curr_id);
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->curr_id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();