本文整理汇总了PHP中force_array函数的典型用法代码示例。如果您正苦于以下问题:PHP force_array函数的具体用法?PHP force_array怎么用?PHP force_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了force_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
global $AdminWidgetsCols;
if ($AdminWidgetsCols === NULL) {
$AdminWidgetsCols = force_array($this->options->get('dashboard_widget_position', User::id()));
}
}
示例2: __set_admin_menu
public function __set_admin_menu()
{
$admin_menus = array('dashboard' => array(array('href' => site_url('dashboard'), 'icon' => 'fa fa-dashboard', 'title' => __('Dashboard')), array('href' => site_url(array('dashboard', 'update')), 'icon' => 'fa fa-dashboard', 'title' => __('Update Center'))), 'modules' => array(array('title' => __('Modules'), 'icon' => 'fa fa-puzzle-piece', 'href' => site_url('dashboard/modules'))), 'settings' => array(array('title' => __('Settings'), 'icon' => 'fa fa-cogs', 'href' => site_url('dashboard/settings'))));
foreach (force_array($this->events->apply_filters('admin_menus', $admin_menus)) as $namespace => $menus) {
foreach ($menus as $menu) {
Menu::add_admin_menu_core($namespace, $menu);
}
}
}
示例3: __initialize
/**
* @param array $options See http://plugins.jquery.com/project/Star_Rating_widget
*/
function __initialize($options = array())
{
parent::__initialize("div");
$this->Options = force_array($options);
$this->Options['inputType'] = 'select';
if (isset($this->Options['disabled'])) {
$this->Options['disabled'] = true;
}
store_object($this);
}
示例4: push_notice_array
/**
* Push Notice notice into
*
*
**/
public function push_notice_array($notice_array)
{
if (is_array($notice_array)) {
foreach (force_array($notice_array) as $notice) {
$this->push_notice(get_instance()->lang->line($notice));
}
} else {
$this->push_notice(get_instance()->lang->line($notice_array));
}
}
示例5: registerPermissions
public function registerPermissions($role, $permissions)
{
if (!$this->roleExists($role)) {
$this->rolePermissions[$role] = [];
}
force_array($permissions);
$n = count($permissions);
for ($i = 0; $i < $n; $i++) {
$this->rolePermissions[$role][] = new Permission($permissions[$i]);
}
}
示例6: add
/**
* Append a single or an array of menu entries.
*
* @param array|MenuEntry $menuEntries
*/
public function add($menuEntries)
{
force_array($menuEntries);
foreach ($menuEntries as $menuEntry) {
$this->menuEntries[$menuEntry->uid] = $menuEntry;
force_array($menuEntry->parentUid);
foreach ($menuEntry->parentUid as $parentUid) {
if ($parentUid === null) {
$parentUid = $this->rootUid;
}
$this->setParent($menuEntry->uid, $parentUid);
}
}
}
示例7: run
function run()
{
if (current_user()->can($this->privilege)) {
create_admin_menu($this->namespace, riake(0, $this->menu_position), riake(1, $this->menu_position));
add_admin_menu($this->namespace, array('title' => $this->label, 'href' => '#', 'is_submenu' => false, 'icon' => $this->menu_icon));
add_admin_menu($this->namespace, array('title' => $this->posts_list_label, 'href' => get_instance()->url->site_url(array('admin', 'posttype', $this->namespace, 'list'))));
add_admin_menu($this->namespace, array('title' => $this->new_post_label, 'href' => get_instance()->url->site_url(array('admin', 'posttype', $this->namespace, 'new'))));
if ($this->comment_enabled === TRUE) {
add_admin_menu($this->namespace, array('title' => $this->post_comment_label, 'href' => get_instance()->url->site_url(array('admin', 'posttype', $this->namespace, 'comments'))));
}
foreach (force_array($this->query->get_defined_taxonomies()) as $taxonomy) {
add_admin_menu($this->namespace, array('title' => riake('taxonomy-list-label', $taxonomy, sprintf(__('%s list'), riake('namespace', $taxonomy))), 'href' => get_instance()->url->site_url(array('admin', 'posttype', $this->namespace, 'taxonomy', riake('namespace', $taxonomy), 'list'))));
add_admin_menu($this->namespace, array('title' => riake('new-taxonomy-label', $taxonomy, sprintf(__('New %s'), riake('namespace', $taxonomy))), 'href' => get_instance()->url->site_url(array('admin', 'posttype', $this->namespace, 'taxonomy', riake('namespace', $taxonomy), 'new'))));
}
}
}
示例8: run
function run()
{
$this->events->add_filter('admin_menus', function ($menus) {
if (User::can($this->privilege)) {
$menus[$this->namespace] = array(array('title' => $this->label, 'href' => '#', 'disable' => true, 'icon' => $this->menu_icon), array('title' => $this->posts_list_label, 'href' => site_url(array('dashboard', 'posttype', $this->namespace, 'list'))), array('title' => $this->new_post_label, 'href' => site_url(array('dashboard', 'posttype', $this->namespace, 'new'))));
if ($this->comment_enabled === TRUE) {
$menus[$this->namespace][] = array('title' => $this->post_comment_label, 'href' => site_url(array('dashboard', 'posttype', $this->namespace, 'comments')));
}
foreach (force_array($this->query->get_defined_taxonomies()) as $taxonomy) {
$menus[$this->namespace][] = array('title' => riake('taxonomy-list-label', $taxonomy, sprintf(__('%s list'), riake('namespace', $taxonomy))), 'href' => site_url(array('dashboard', 'posttype', $this->namespace, 'taxonomy', riake('namespace', $taxonomy), 'list')));
$menus[$this->namespace][] = array('title' => riake('new-taxonomy-label', $taxonomy, sprintf(__('New %s'), riake('namespace', $taxonomy))), 'href' => site_url(array('dashboard', 'posttype', $this->namespace, 'taxonomy', riake('namespace', $taxonomy), 'new')));
}
}
return $menus;
});
}
示例9: registerLanguage
/**
* @string string $code GNU Gettext code language
* @string array $aliases You can specify language aliases (in lower case)
* @string string $encode Override the default GNU Gettext language encode
*/
function registerLanguage($code, $aliases = [], $encode = null, $iso = null)
{
if ($encode === null) {
$encode = $this->gettextDefaultEncode;
}
if ($encode === null) {
DEBUG && error(sprintf(_("Non hai specificato una codifica per la lingua '%s' e non ce n'è una predefinita. Impostala con la costante %s."), esc_html($code), 'GETTEXT_DEFAULT_ENCODE'));
return false;
}
$this->languages[++$this->i] = new BozPHPLanguage($code, $encode, $iso);
// Yes, the language code it's an alias to itself. That's a lazy hack!
$this->aliases[strtolower($code)] = $this->i;
// Each alias is associated to it's language code
force_array($aliases);
foreach ($aliases as $alias) {
$this->aliases[$alias] = $this->i;
}
}
示例10: fetch_notice_output
function fetch_notice_output($e, $extends_msg = '', $sort = FALSE)
{
if ($e === TRUE) {
?>
<style>
.notice_sorter
{
border:solid 1px #999;
color:#333;
}
.notice_sorter thead td
{
padding:2px 10px;
text-align:center;
background:#EEE;
background:-moz-linear-gradient(top,#EEE,#CCC);
border:solid 1px #999;
}
.notice_sorter tbody td
{
padding:2px 10px;
text-align:justify;
background:#FFF;
border:solid 1px #999;
}
</style><table class="notice_sorter"><thead>
<style>
.notice_sorter
{
border:solid 1px #999;
color:#333;
}
.notice_sorter thead td
{
padding:2px 10px;
text-align:center;
background:#EEE;
background:-moz-linear-gradient(top,#EEE,#CCC);
border:solid 1px #999;
}
.notice_sorter tbody td
{
padding:2px 10px;
text-align:justify;
background:#FFF;
border:solid 1px #999;
}
</style>
<tr><td>Index</td><td>Code</td><td>Description</td></tr></thead><tbody><?php
$index = 1;
foreach ($__ as $k => $v) {
?>
<tr><td><?php
echo $index;
?>
</td><td><?php
echo $k;
?>
</td><td><?php
echo strip_tags($v);
?>
</td></tr><?php
$index++;
}
?>
</tbody></table><?php
} else {
if (is_string($e)) {
$notices = force_array(get_core_vars('tendoo_notices'));
if (in_array($e, $notices) || array_key_exists($e, $notices)) {
return $notices[$e];
} else {
if (isset($notices)) {
if (array_key_exists($e, $notices)) {
return $notices[$e];
} else {
return tendoo_warning(__(sprintf('"%s" is not a valid error code', $e)));
}
} else {
if ($e != '' && strlen($e) <= 50) {
return tendoo_warning(__(sprintf('"%s" is not a valid error code', $e)));
} else {
return $e;
}
}
}
}
return false;
}
}
示例11: ob_get_clean
$(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();
示例12: is_active
/**
* Is Active
*
* Checks whether a module is active
*
* @access public
* @author blair Jersyer
* @copyright 2015
* @param string $module_namespace
* @param bool $fresh
* @since 3.0.1
* @return bool
*/
static function is_active($module_namespace, $fresh = false)
{
global $Options;
if ($fresh === TRUE) {
$activated_modules = riake('actives_modules', $Options);
} else {
$activated_modules = self::$actives;
}
if (in_array($module_namespace, force_array($activated_modules), true)) {
return true;
}
return false;
}
示例13: foreach
<div class="row">
<?php
foreach (force_array($this->gui->get_cols()) as $col_id => $col_data) {
?>
<div class="col-lg-<?php
echo riake('width', $col_data, 1) * 3;
?>
">
<?php
$config = riake('configs', $col_data);
// Inner Opening Wrapper
echo $this->events->apply_filters('gui_opening_wrapper', '');
// looping $col_data[ 'metas' ];
foreach (force_array(riake('metas', $col_data)) as $meta) {
// get meta type
if (in_array($meta_type = riake('type', $meta), array('box-default', 'box-primary', 'box-success', 'box-info', 'box-warning', 'box'))) {
// meta icon ?
$icon = riake('icon', $meta, false);
// enable gui form saver
$form_expire = gmt_to_local(time(), 'UTC') + GUI_EXPIRE;
$ref = urlencode(current_url());
$use_namespace = riake('use_namespace', $meta, false);
$class = riake('classes', riake('custom', $meta));
$id = riake('id', riake('custom', $meta));
$action = riake('action', riake('custom', $meta), site_url(array('dashboard', 'options', 'save')));
$method = riake('method', riake('custom', $meta), 'POST');
$enctype = riake('enctype', riake('custom', $meta), 'multipart/form-data');
$namespace = riake('namespace', $meta);
if (riake('gui_saver', $meta)) {
示例14: Tr
/**
* Creates a new row.
*
* @param array $data If given creates new cells in the row (see <Tr::NewCell>)
* @param array $options See <Tr> for options
* @return type
*/
function &NewRow($data = false, $options = false)
{
$this->current_row = new Tr($options ? $options : $this->RowOptions);
$this->content($this->current_row);
if ($data) {
$i = 0;
foreach (force_array($data) as $rowdata) {
$cell = $this->current_row->NewCell($rowdata);
if ($this->table && $this->table->colgroup && isset($this->table->colgroup->_content[$i]) && isset($this->table->colgroup->_content[$i]->_attributes["align"]) && $this->table->colgroup->_content[$i]->_attributes["align"]) {
$cell->align = $this->table->colgroup->_content[$i]->_attributes["align"];
}
$i++;
}
}
return $this->current_row;
}
示例15: display_login_fields
/**
* Default behavior when no auth module is installed
**/
function display_login_fields()
{
foreach (force_array($this->config->item('signin_fields')) as $fields) {
echo $fields;
}
}