예제 #1
0
<?php

$this->gui->cols_width(1, 4);
$this->gui->set_meta(array('type' => 'panel', 'title' => __('Install/Update Apps'), 'namespace' => core_meta_namespace(array('admin', 'installer')), 'form_wrap' => array('submit_text' => __('Install'), 'enctype' => 'multipart/form-data')))->push_to(1);
$this->gui->set_item(array('type' => 'file', 'name' => 'installer_file', 'label' => __('Choose a file to upload'), 'description' => __(sprintf('Install new app. The install file must necessary be a zip file, and should be compatible with your current Tendoo Version : <strong>%s</strong>. Be safe, and install app from secure provider.', get('core_id')))))->push_to(core_meta_namespace(array('admin', 'installer')));
$this->gui->get();
return;
?>

<?php 
echo get_core_vars('inner_head');
?>
<section id="w-f">
    <section class="hbox stretch">
        <?php 
echo get_core_vars('lmenu');
?>
        <section class="scrollable" id="pjax-container">
            <header>
                <div class="row b-b m-l-none m-r-none">
                    <div class="col-sm-4">
                        <h4 class="m-t m-b-none"><?php 
echo get_page('title');
?>
</h4>
                        <p class="block text-muted"><?php 
echo translate('install a new application');
?>
</p>
                    </div>
                     <div class="col-sm-8">
예제 #2
0
<?php

$this->gui->cols_width(1, 4);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('users', 'edit')), 'title' => __('Edit user'), 'type' => 'panel', 'form_wrap' => array('method' => 'POST')))->push_to(1);
$this->gui->set_item(array('type' => 'text', 'attrs' => array('readonly' => 'readonly'), 'value' => $adminInfo['PSEUDO'], 'placeholder' => __('User Pseudo'), 'label' => __('User Pseudo')))->push_to(core_meta_namespace(array('users', 'edit')));
$this->gui->set_item(array('type' => 'text', 'name' => 'user_email', 'placeholder' => __('Enter Email'), 'text' => __('User Email'), 'label' => __('User Email'), 'value' => $adminInfo['EMAIL']))->push_to(core_meta_namespace(array('users', 'edit')));
// Get Roles
$text[] = __('User Role');
$value[] = '';
foreach (force_array($get_roles) as $_role) {
    $value[] = riake('ID', $_role);
    $text[] = riake('NAME', $_role);
}
$this->gui->set_item(array('type' => 'select', 'name' => 'edit_priv', 'value' => $value, 'placeholder' => __('Select User Role'), 'text' => $text, 'active' => $adminInfo['REF_ROLE_ID'], 'label' => __('User Role')))->push_to(core_meta_namespace(array('users', 'edit')));
$this->gui->set_item(array('type' => 'hidden', 'name' => 'current_admin', 'value' => $adminInfo['PSEUDO']))->push_to(core_meta_namespace(array('users', 'edit')));
// Loading Generated Fields using "user_fields" hook
$user_fields = trigger_filters('user_form_fields', array(get_core_vars('tendoo_user_fields'), $adminInfo['ID']));
// Filter user fields or add
foreach (force_array($user_fields) as $field) {
    $this->gui->set_item($field)->push_to(core_meta_namespace(array('users', 'edit')));
}
$this->gui->set_item(array('type' => 'buttons', 'name' => array('set_admin', 'delete_admin'), 'value' => array(__('Save User'), __('Delete User')), 'classes' => array('btn-primary', 'btn-warning'), 'button_types' => array('submit', 'submit'), 'attrs_string' => array('', 'onclick="return confirm( \'' . __('Do you really want to delete this user ?') . '\')" ')))->push_to(core_meta_namespace(array('users', 'edit')));
$this->gui->get();
예제 #3
0
/**
 * return a almost unique namespace for meta box for plugin which use GUI
 * @return string or bool (false)
 **/
function meta_namespace($segments)
{
    if ($opened_module = get_core_vars('opened_module')) {
        return core_meta_namespace($segments, riake('namespace', $opened_module, 'custom'));
    }
    return false;
}
예제 #4
0
<?php

$this->gui->cols_width(1, 4);
$this->gui->enable(array('pagination'));
$this->gui->set_meta(array('type' => 'panel-ho', 'title' => __('Roles'), 'namespace' => core_meta_namespace(array('roles', 'list'))))->push_to(1);
foreach (force_array($get_roles) as $_role) {
    $rows[] = array($_role['ID'], '<a href="' . $this->instance->url->site_url(array('admin', 'roles', 'edit', $_role['ID'])) . '">' . $_role['NAME'] . '</a>', $_role['DESCRIPTION'], timespan(strtotime($_role['DATE']), $this->instance->date->timestamp()), $_role['IS_SELECTABLE'] == "1" ? __('Yes') : __('No'), '<a href="' . $this->instance->url->site_url(array('admin', 'roles', 'delete', $_role['ID'])) . '">' . __('Delete') . '</a>');
}
$this->gui->set_item(array('type' => 'table', 'cols' => array(__('Id'), __('Name'), __('Description'), __('Created'), __('Available on registration'), __('Delete')), 'rows' => $rows))->push_to(core_meta_namespace(array('roles', 'list')));
$this->gui->get();
예제 #5
0
			$(modal).find('.modal-body').find('[data-action="activate"]').bind('click',function(){
				if($(papa).length > 0)
				{
					$(papa).find('[data-action="ADMITSETDEFAULT"]').trigger('click');
					$(modal).find('.modal-body').find('[data-action="activate"]').attr('disabled','disabled');
				}
				return false;
			});
		}
	});
});
</script>
<?php 
$footer_script = ob_get_clean();
$this->gui->col_config(1, array('inner-opening-wrapper' => '<div class="row themes_grid">', 'inner-closing-wrapper' => '</div>', 'footer-script' => $footer_script));
$this->gui->cols_width(1, 4);
foreach (force_array($themes_list) as $_theme) {
    $footer_buttons = array();
    $status = riake('active', $_theme) === true ? 'disabled="disabled"' : '';
    $footer_buttons[] = array('text' => __('Activate'), 'attrs' => 'data-action="ADMITSETDEFAULT" ' . $status);
    $footer_buttons[] = array('text' => __('Delete'), 'attrs' => 'data-action="ADMITDELETETHEME"');
    $footer_buttons[] = array('text' => __('Details'), 'attrs' => 'data-action="OPENDETAILS"');
    $this->gui->set_meta(array('type' => 'panel-footer', 'title' => riake('name', $_theme), 'namespace' => core_meta_namespace(array('admin', 'themes', riake('namespace', $_theme))), 'opening-wrapper' => '<div class="col-lg-3 theme_head"  
		data-theme_namespace="' . $_theme['namespace'] . '" 
		data-theme_name="' . $_theme['name'] . '"
		data-theme_thumb="' . theme_thumb($_theme['namespace']) . '"
		data-theme_author="' . $_theme['author'] . '"
		data-theme_version="' . $_theme['version'] . '"><input type="hidden" class="theme_details" value="' . htmlentities($_theme['description']) . '">', 'closing-wrapper' => '</div>', 'footer-buttons' => $footer_buttons))->push_to(1);
    $this->gui->set_item(array('type' => 'dom', 'value' => '<img src="' . theme_thumb($_theme['namespace']) . '" style="width:100%;min-height:250px;">'))->push_to(core_meta_namespace(array('admin', 'themes', riake('namespace', $_theme))));
}
$this->gui->get();
예제 #6
0
<?php

$this->gui->cols_width(1, 4);
// Creating Meta
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('users', 'create')), 'title' => __('Create User'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'submit_text' => __('Create user'), 'reset_text' => __('Reset Form'))))->push_to(1);
$this->gui->set_meta(array('namespace' => 'tips', 'title' => __('How to create a user'), 'type' => 'panel'))->push_to(2);
// Creating Fields
// Static Fields
$this->gui->set_item(array('type' => 'text', 'name' => 'admin_pseudo', 'placeholder' => __('Enter a Username'), 'label' => __('Username')))->push_to(core_meta_namespace(array('users', 'create')));
$this->gui->set_item(array('type' => 'password', 'name' => 'admin_password', 'placeholder' => __('Password'), 'label' => __('Enter a password')))->push_to(core_meta_namespace(array('users', 'create')));
$this->gui->set_item(array('type' => 'password', 'name' => 'admin_password_confirm', 'placeholder' => __('Confirm password'), 'label' => __('Confirm password')))->push_to(core_meta_namespace(array('users', 'create')));
$this->gui->set_item(array('type' => 'text', 'name' => 'admin_password_email', 'placeholder' => __('Email'), 'label' => __('Enter a user email')))->push_to(core_meta_namespace(array('users', 'create')));
$this->gui->set_item(array('type' => 'select', 'name' => 'admin_sex', 'placeholder' => __('Select user sex'), 'value' => array('', 'MASC', 'FEM'), 'text' => array(__('Choose...'), __('Male'), __('Female')), 'label' => __('User Sex')))->push_to(core_meta_namespace(array('users', 'create')));
$roles = array('');
$text = array(__('Choose...'));
foreach (force_array($getPrivs) as $_role) {
    $roles[] = riake('ID', $_role);
    $text[] = riake('NAME', $_role);
}
$this->gui->set_item(array('type' => 'select', 'name' => 'admin_privilege', 'placeholder' => __('Select user role'), 'value' => $roles, 'text' => $text, 'label' => __('User role')))->push_to(core_meta_namespace(array('users', 'create')));
// Loading Generated Fields using "user_form_fields" hook
$user_fields = trigger_filters('user_form_fields', array(get_core_vars('tendoo_user_fields')));
// Filter user fields or add
foreach (force_array($user_fields) as $field) {
    $this->gui->set_item($field)->push_to(core_meta_namespace(array('users', 'create')));
}
$this->gui->get();
예제 #7
0
<?php

$this->gui->cols_width(1, 4);
$this->gui->set_meta(core_meta_namespace(array('users', 'list')), __('Users'), 'panel-ho')->push_to(1);
$rows = array();
$subadmin = get_core_vars('get_users');
if (is_array($subadmin)) {
    if (count($subadmin) > 0) {
        foreach ($subadmin as $s) {
            $role = $this->instance->roles->get($s['REF_ROLE_ID']);
            if (!$role) {
                $priv[0]['NAME'] = $this->instance->users_global->convertCurrentPrivilege($s['REF_ROLE_ID']);
            }
            $rows[] = array($s['ID'], '<a href="' . $this->instance->url->site_url(array('admin', 'users', 'edit', $s['PSEUDO'])) . '">' . $s['PSEUDO'] . '</a>', $role[0]['NAME'], $s['EMAIL'] == '' ? __('Unavailable') : $s['EMAIL']);
        }
    }
}
gui_item(array('label' => 'Contenu', 'type' => 'table-panel', 'name' => 'nom', 'id' => 'mon_editeur', 'cols' => array(__('Id'), __('Pseudo'), __('Role'), __('Email')), 'rows' => $rows))->push_to(core_meta_namespace(array('users', 'list')));
$this->gui->get();
예제 #8
0
<?php

$this->gui->cols_width(1, 3);
$this->gui->cols_width(2, 1);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('roles', 'create')), 'title' => __('Create a new role'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'submit_text' => __('Create Role'))))->push_to(1);
// Creating Form
$this->gui->set_item(array('type' => 'text', 'name' => 'priv_name', 'description' => __('Set unique name to identify this role.'), 'label' => __('Role name'), 'placeholder' => __('Role name')))->push_to(core_meta_namespace(array('roles', 'create')));
$this->gui->set_item(array('type' => 'select', 'name' => 'is_selectable', 'description' => __('Set to yes will makes this role will available for registration.'), 'label' => __('Available for registration ?'), 'placeholder' => __('Choose'), 'value' => array(0, 1), 'text' => array(__('No'), __('Yes'))))->push_to(core_meta_namespace(array('roles', 'create')));
$this->gui->set_item(array('type' => 'textarea', 'name' => 'priv_description', 'description' => __('Describe this role. The reason why you\'re creating this role.'), 'label' => __('Description'), 'placeholder' => __('Description')))->push_to(core_meta_namespace(array('roles', 'create')));
$this->gui->get();
예제 #9
0
<?php

$this->gui->cols_width(1, 3);
$this->gui->cols_width(2, 1);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('roles', 'edit')), 'title' => __('Edit a role'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'submit_text' => __('Edit Role'))))->push_to(1);
// Creating Form
$this->gui->set_item(array('type' => 'text', 'name' => 'priv_name', 'value' => riake('NAME', $get_role[0]), 'description' => __('Set unique name to identify this role.'), 'label' => __('Role name'), 'placeholder' => __('Role name')))->push_to(core_meta_namespace(array('roles', 'edit')));
$this->gui->set_item(array('type' => 'select', 'name' => 'is_selectable', 'description' => __('Set to yes will makes this role will available for registration.'), 'label' => __('Available for registration ?'), 'placeholder' => __('Choose'), 'value' => array(0, 1), 'active' => riake('IS_SELECTABLE', $get_role[0]), 'text' => array(__('No'), __('Yes'))))->push_to(core_meta_namespace(array('roles', 'edit')));
$this->gui->set_item(array('type' => 'textarea', 'name' => 'priv_description', 'description' => __('Describe this role. The reason why you\'re creating this role.'), 'label' => __('Description'), 'placeholder' => __('Description'), 'value' => riake('DESCRIPTION', $get_role[0])))->push_to(core_meta_namespace(array('roles', 'edit')));
$this->gui->get();
예제 #10
0
<?php

$this->gui->cols_width(1, 4);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('admin', 'modules')), 'title' => __('Available modules'), 'type' => 'panel-ho'))->push_to(1);
foreach (force_array($modules_list) as $_module) {
    $theme_status = ($active_theme = does_active_theme_support($_module['handle']) && $_module['handle'] != 'APP') == FALSE ? sprintf(__('Active theme %s doesn\'t support this module.'), '<strong>' . $active_theme['name'] . '</strong>') . ' | ' : '';
    if ($_module['active'] === false) {
        $status_link = '<a class="delete" href="' . $this->instance->url->site_url(array('admin', 'active', 'module', $_module['namespace'])) . '"><i style="font-size:25px;" class="fa fa-times" title="' . __('Click here to enable') . '"></i></a>';
    } else {
        $status_link = '<a class="delete" href="' . $this->instance->url->site_url(array('admin', 'unactive', 'module', $_module['namespace'])) . '"><i style="font-size:25px;" class="fa fa-check" title="' . __('Click here to disable') . '"></i></a>';
    }
    $uninstall_link = '<a onclick="return confirm( \' ' . __('Are you sure you want to remove this module ? ') . '\' )" class="delete" href="' . $this->instance->url->site_url(array('admin', 'uninstall', 'module', $_module['namespace'])) . '"><i style="font-size:25px;" class="fa fa-trash-o" title="' . __('Uninstall') . '"></i></a>';
    $rows[] = array('<strong>' . $_module['name'] . '</strong><br><p>' . $_module['description'] . '</p><hr class="line-dashed" style="margin:2px 0;"><small>' . $theme_status . '</small> <small>' . $_module['handle'] . '</small>', $_module['author'], $_module['version'], $status_link, $uninstall_link);
}
$this->gui->set_item(array('name' => core_meta_namespace(array('admin', 'modules', 'table')), 'type' => 'table-panel', 'cols' => array(__('Module details'), __('Author'), __('Version'), '', ''), 'rows' => $rows))->push_to(core_meta_namespace(array('admin', 'modules')));
$this->gui->get();
return;
?>

<?php 
echo get_core_vars('inner_head');
?>

<section>
    <section class="hbox stretch">
        <?php 
echo get_core_vars('lmenu');
?>
        <section>
            <section class="vbox">
                <section class="scrollable">
예제 #11
0
$this->gui->set_meta(array('title' => __('General Settings'), 'namespace' => $general_settings, 'form_wrap' => array('method' => 'post', 'gui_saver' => true, 'submit_text' => __('Save Settings'))))->push_to(1);
foreach (force_array(get_instance()->date->getFuseau()) as $_timezone) {
    $value[] = riake('Code', $_timezone);
    $text[] = riake('Index', $_timezone) . ' - ' . riake('States', $_timezone);
}
$this->gui->set_item(array('type' => 'select', 'name' => 'site_timezone', 'value' => $value, 'text' => $text, 'placeholder' => __('Select a timezone'), 'label' => __('Select a timezone'), 'active' => riake('site_timezone', $options)))->push_to($general_settings);
$timeformat = array('%d-%m-%Y' => '%d-%m-%Y (' . get_instance()->date->datetime('%d') . '-' . get_instance()->date->datetime('%m') . '-' . get_instance()->date->datetime('%Y') . ')', '%Y/%m/%d' => '%Y/%m/%d (' . get_instance()->date->datetime('%Y') . '/' . get_instance()->date->datetime('%m') . '/' . get_instance()->date->datetime('%d') . ')', '%Y-%m-%Y' => '%Y-%m-%Y (' . get_instance()->date->datetime('%Y') . '-' . get_instance()->date->datetime('%m') . '-' . get_instance()->date->datetime('%d') . ')');
foreach ($timeformat as $value => $text) {
    $timeformat_text[] = $text;
    $timeformat_value[] = $value;
}
$this->gui->set_item(array('type' => 'select', 'name' => 'site_timeformat', 'value' => $timeformat_value, 'text' => $timeformat_text, 'placeholder' => __('Select a time format'), 'label' => __('Select a time format'), 'active' => riake('site_timeformat', $options)))->push_to($general_settings);
$this->gui->set_item(array('type' => 'text', 'name' => 'site_name', 'value' => riake('site_name', $options), 'label' => __('Website name'), 'placeholder' => __('Enter the website name')))->push_to($general_settings);
$this->gui->set_item(array('type' => 'textarea', 'name' => 'site_description', 'value' => riake('site_description', $options), 'label' => __('Website description'), 'placeholder' => __('Enter the website description'), 'description' => __('Just say a little more about this website')))->push_to($general_settings);
// Advanced settings metabox
$advanced_settings = core_meta_namespace(array('admin', 'settings', 'advanced'));
$this->gui->set_meta(array('title' => __('Advanced Settings'), 'namespace' => $advanced_settings, 'form_wrap' => array('method' => 'post', 'gui_saver' => true, 'submit_text' => __('Save Settings'))))->push_to(2);
$this->gui->set_item(array('type' => 'select', 'placeholder' => __('Select Tendoo Mode'), 'description' => __('This option allow you to turn tendoo into "web app" mode, which disable front-end, related modules and themes interface.'), 'name' => 'tendoo_mode', 'text' => array(__('Website mode'), __('WebApp mode')), 'value' => array('website', 'webapp'), 'label' => __('Tendoo mode'), 'active' => riake('tendoo_mode', $options)))->push_to($advanced_settings);
$this->gui->set_item(array('type' => 'select', 'placeholder' => __('Choose option'), 'description' => __('This option allow you to enable automatic updates.'), 'name' => 'tendoo_update', 'text' => array(__('Yes and report me what\'s new'), __('Yes, but in silent'), __('No, just let me know'), __('No and don\'t let me know')), 'value' => array('yes', 'silent_mode', 'report', 'disconnected'), 'label' => __('Enable automatic update'), 'active' => riake('tendoo_update', $options)))->push_to($advanced_settings);
$this->gui->set_item(array('type' => 'select', 'placeholder' => __('Choose option'), 'description' => __('This option enable registration on your website.'), 'name' => 'tendoo_registration_status', 'text' => array(__('Yes'), __('No')), 'value' => array(1, 0), 'label' => __('Anyone can register ?'), 'active' => riake('tendoo_registration_status', $options)))->push_to($advanced_settings);
$this->gui->set_item(array('type' => 'select', 'placeholder' => __('Choose option'), 'description' => __('You can enable role selection on registration. You may need to set on roles, which ones are selectable. Be careful of the role you define available for registration.'), 'name' => 'tendoo_role_selection', 'text' => array(__('Yes'), __('No')), 'value' => array(1, 0), 'label' => __('Allow role selection'), 'active' => riake('tendoo_role_selection', $options)))->push_to($advanced_settings);
$this->gui->set_item(array('type' => 'select', 'placeholder' => __('Choose option'), 'description' => __('This option allow you to open dashboard for role available on registration.'), 'name' => 'tendoo_open_dashboard', 'text' => array(__('Yes'), __('No')), 'value' => array(1, 0), 'label' => __('Open dashboard'), 'active' => riake('tendoo_open_dashboard', $options)))->push_to($advanced_settings);
// Widget Content
$this->gui->set_meta(array())->push_to(2);
$this->gui->get();
return;
echo get_core_vars('inner_head');
?>

<section id="content">
<section class="hbox stretch">
예제 #12
0
$this->gui->cols_width(1, 2);
$this->gui->cols_width(2, 2);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('users', 'profile')), 'title' => __('Users Names'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'submit_text' => __('Edit profile'), 'enctype' => 'multipart/form-data')))->push_to(1);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('users', 'reset')), 'title' => __('Reset Account'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'enctype' => 'multipart/form-data')))->push_to(1);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('users', 'advanced')), 'title' => __('Advanced Settings'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'submit_text' => __('Save Advanced settings'), 'enctype' => 'multipart/form-data')))->push_to(2);
$this->gui->set_meta(array('namespace' => core_meta_namespace(array('users', 'widgets')), 'title' => __('Widgets'), 'type' => 'panel', 'form_wrap' => array('method' => 'post', 'submit_text' => __('Save widgets'), 'enctype' => 'multipart/form-data')))->push_to(2);
// User Reset
$this->gui->set_item(array('type' => 'buttons', 'value' => array(__('Reset Account')), 'types' => array('text'), 'name' => array('reset_account'), 'attrs' => array(array('confirm-do' => 'click', 'confirm-text' => __('Do you really want to reset your account settings ?'))), 'description' => __('This option will restore account settings. Personnal datas will been kept')))->push_to(core_meta_namespace(array('users', 'reset')));
// User Profile
$this->gui->set_item(array('type' => 'text', 'name' => 'user_name', 'label' => __('User Name'), 'placeholder' => __('Enter User Name'), 'value' => current_user('name')))->push_to(core_meta_namespace(array('users', 'profile')));
$this->gui->set_item(array('type' => 'text', 'name' => 'user_surname', 'label' => __('User Surname'), 'placeholder' => __('Enter User Surname'), 'value' => current_user('surname')))->push_to(core_meta_namespace(array('users', 'profile')));
$this->gui->set_item(array('type' => 'text', 'name' => 'user_state', 'label' => __('User State'), 'placeholder' => __('Enter User State'), 'value' => current_user('state')))->push_to(core_meta_namespace(array('users', 'profile')));
$this->gui->set_item(array('type' => 'text', 'name' => 'user_town', 'label' => __('User City'), 'placeholder' => __('Enter User City'), 'value' => current_user('city')))->push_to(core_meta_namespace(array('users', 'profile')));
$this->gui->set_item(array('type' => 'file', 'name' => 'avatar_file', 'label' => __('User Avatar'), 'description' => __('Avatar pics should not exceed 300px on height and width')))->push_to(core_meta_namespace(array('users', 'profile')));
$this->gui->set_item(array('type' => 'textarea', 'name' => 'bio', 'label' => __('More about you'), 'description' => __('provide more information about you in this field. It may be used by themes.'), 'value' => current_user('bio')))->push_to(core_meta_namespace(array('users', 'profile')));
$this->gui->set_item(array('type' => 'hidden', 'name' => 'avatar_usage', 'value' => 'system'))->push_to(core_meta_namespace(array('users', 'profile')));
// Advanced Settings
$themes = adminlte_skin_names();
$values = array_keys($themes);
$this->gui->set_item(array('type' => 'select', 'name' => 'dashboard_theme', 'value' => $values, 'text' => $themes, 'active' => current_user('dashboard_theme'), 'label' => __('Dashboard Theme')))->push_to(core_meta_namespace(array('users', 'advanced')));
$this->gui->set_item(array('type' => 'password', 'name' => 'user_oldpass', 'label' => __('Old password'), 'description' => __('To change a password, you must enter the previous password.')))->push_to(core_meta_namespace(array('users', 'advanced')));
$this->gui->set_item(array('type' => 'password', 'name' => 'user_newpass', 'label' => __('New password'), 'description' => __('It should be different from the previous one.')))->push_to(core_meta_namespace(array('users', 'advanced')));
$this->gui->set_item(array('type' => 'password', 'name' => 'user_confirmnewpass', 'label' => __('Confirm password'), 'description' => __('It should match the new password.')))->push_to(core_meta_namespace(array('users', 'advanced')));
// Admin widgets
$declared_admin_widgets = get_core_vars('admin_widgets');
foreach (force_array($declared_admin_widgets) as $_widget) {
    $checked = $this->users_global->isAdminWidgetEnabled($_widget['widget_namespace'] . '/' . $_widget['module_namespace']) && get_instance()->users_global->adminWidgetHasWidget() ? 'checked="checked"' : '';
    $admin_widget_rows[] = array('<input ' . $checked . ' type="checkbox" name="widget_action[]" value="' . $_widget['widget_namespace'] . '/' . $_widget['module_namespace'] . '"><input type="hidden" name="widget_namespace[]" value="' . $_widget['widget_namespace'] . '/' . $_widget['module_namespace'] . '">', $_widget['widget_title']);
}
$this->gui->set_item(array('type' => 'table', 'cols' => array('<input type="checkbox" id="multiplecheck">', __('Widget name')), 'rows' => $admin_widget_rows))->push_to(core_meta_namespace(array('users', 'widgets')));
$this->gui->get();
예제 #13
0
<?php

$this->gui->cols_width(1, 4);
// Unique meta box
// var_dump( $get_roles );
// get modules permissions
foreach (force_array($get_roles) as $_role) {
    $this->gui->set_meta(array('type' => 'panel', 'namespace' => core_meta_namespace(array('roles', 'permissions', riake('ID', $_role))), 'title' => riake('NAME', $_role), 'form_wrap' => array('method' => 'post', 'submit_text' => __('Save Role Permissions'))))->push_to(1);
    foreach (force_array($get_modules) as $key => $_modules) {
        $checked = $name = $text = $value = array();
        foreach (riake('declared_actions', $_modules, array()) as $_actions) {
            $checked[] = $this->roles->can(riake('ID', $_role), $_actions['mod_namespace'] . '@' . $_actions['action']);
            $value[] = $_actions['mod_namespace'] . '@' . $_actions['action'];
            $name[] = 'roles_permissions[]';
            $text[] = $_actions['action_name'];
        }
        $this->gui->set_item(array('type' => 'title', 'title' => $_modules['name']))->push_to(core_meta_namespace(array('roles', 'permissions', riake('ID', $_role))));
        $this->gui->set_item(array('type' => 'checkbox', 'name' => $name, 'value' => $value, 'label' => $text, 'checked' => $checked))->push_to(core_meta_namespace(array('roles', 'permissions', riake('ID', $_role))));
    }
    $this->gui->set_item(array('type' => 'hidden', 'name' => 'role_id', 'value' => riake('ID', $_role)))->push_to(core_meta_namespace(array('roles', 'permissions', riake('ID', $_role))));
}
$this->gui->get();