当前位置: 首页>>代码示例>>PHP>>正文


PHP Get::state_menu方法代码示例

本文整理汇总了PHP中Get::state_menu方法的典型用法代码示例。如果您正苦于以下问题:PHP Get::state_menu方法的具体用法?PHP Get::state_menu怎么用?PHP Get::state_menu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Get的用法示例。


在下文中一共展示了Get::state_menu方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: md5

            // backend
        }
    }
    Weapon::fire(array('plugin_after', 'plugin_' . md5($k) . '_after'));
}
Weapon::fire('plugins_after');
/**
 * Check the Plugin(s) Order
 * -------------------------
 */
// var_dump($plugins); exit;
/**
 * Loading Menu(s)
 * ---------------
 */
foreach (Get::state_menu() as $key => $value) {
    Menu::add($key, $value);
}
/**
 * Handle Shortcode(s) in Content
 * ------------------------------
 */
function do_shortcode($content)
{
    if (strpos($content, '{{') === false) {
        return $content;
    }
    foreach (Get::state_shortcode() as $key => $value) {
        $key = preg_quote($key, '#');
        // %[a,b,c]: option(s) ... accept `a`, `b`, or `c`
        if (strpos($key, '%\\[') !== false) {
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:ignite.php

示例2: function

<?php

/**
 * Menu Manager
 * ------------
 */
Route::accept($config->manager->slug . '/menu', function () use($config, $speak) {
    if (Guardian::get('status') !== 'pilot') {
        Shield::abort();
    }
    $menus = Get::state_menu();
    Config::set(array('page_title' => $speak->menus . $config->title_separator . $config->manager->title, 'cargo' => DECK . DS . 'workers' . DS . 'cargo.menu.php'));
    $G = array('data' => array('content' => $menus));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        // Check for invalid input
        if (preg_match('#(^|\\n)(\\t| {1,3})(?:[^ ])#', $request['content'])) {
            Notify::error($speak->notify_invalid_indent_character);
            Guardian::memorize($request);
        }
        $P = array('data' => $request);
        if (!Notify::errors()) {
            File::write($request['content'])->saveTo(STATE . DS . 'menu.txt', 0600);
            Notify::success(Config::speak('notify_success_updated', $speak->menu));
            Weapon::fire('on_menu_update', array($G, $P));
            Guardian::kick($config->url_current);
        }
    }
    Shield::lot(array('segment' => 'menu', 'the_content' => $menus))->attach('manager', false);
});
开发者ID:razordaze,项目名称:mecha-cms,代码行数:30,代码来源:route.menu.php

示例3: array

            Notify::success(Config::speak('notify_success_' . (!$key ? 'created' : 'updated'), $speak->menu));
            Weapon::fire(array('on_menu_update', 'on_menu_' . (!$key ? 'construct' : 'repair')), array($G, $P));
            Guardian::kick($key !== $k ? $config->manager->slug . '/menu' : $config->manager->slug . '/menu/repair/key:' . $key);
        }
    }
    Shield::lot(array('segment' => 'menu', 'id' => $key, 'content' => $menu_raw))->attach('manager');
});
/**
 * Menu Killer
 * -----------
 */
Route::accept($config->manager->slug . '/menu/kill/key:(:any)', function ($key = false) use($config, $speak) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    $menus = Get::state_menu(null, array(), false);
    if (!isset($menus[$key])) {
        Shield::abort();
        // Menu not found!
    }
    Config::set(array('page_title' => $speak->deleting . ': ' . $speak->menu . $config->title_separator . $config->manager->title, 'cargo' => 'kill.menu.php'));
    $G = array('data' => $menus);
    $G['data']['key'] = $key;
    if ($request = Request::post()) {
        $request = Filter::apply('request:__menu', $request, $key);
        Guardian::checkToken($request['token']);
        unset($menus[$key]);
        // delete ...
        ksort($menus);
        $P = array('data' => $menus);
        $P['data']['key'] = $key;
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:31,代码来源:route.menu.php

示例4: array

 if (isset($c->spam_keywords)) {
     $c->keywords_spam = $c->spam_keywords;
 }
 if (isset($c->excerpt_length)) {
     $c->excerpt = (object) array('length' => $c->excerpt_length, 'prefix' => "", 'suffix' => $c->excerpt_tail, 'id' => 'more:%d');
 }
 if (is_bool($c->comments)) {
     $c->comments = (object) array('allow' => $c->comments, 'moderation' => $c->comment_moderation);
 }
 if ($c->html_parser === false) {
     $c->html_parser = 'HTML';
 }
 if (!is_object($c->html_parser)) {
     $c->html_parser = (object) array('type' => array('HTML' => 'HTML'), 'active' => $c->html_parser);
 }
 $menus = Get::state_menu(null, false);
 if (!isset($menus['navigation'])) {
     $menus['navigation'] = $menus;
     File::serialize($menus)->saveTo(STATE . DS . 'menu.txt', 0600);
 }
 if ($tag = Get::state_tag(null, false)) {
     if (isset($tag[0]['id'])) {
         $tags = array();
         foreach ($tag as $t) {
             $tags[$t['id']] = array('name' => $t['name'], 'slug' => $t['slug'], 'description' => $t['description'], 'scope' => 'article');
         }
         File::serialize($tags)->saveTo(STATE . DS . 'tag.txt', 0600);
     }
 }
 if (is_string($c->author)) {
     $c->author = (object) array('name' => $c->author, 'email' => $c->author_email, 'url' => $c->author_profile_url);
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:__candle-light-1.2.0.php

示例5: get

 public static function get($array = null, $type = 'ul', $depth = "", $FP = "")
 {
     // Use menu file from the cabinet if `$array` is not defined
     if (is_null($array)) {
         $FP = 'navigation:';
         $array = Text::toArray(Get::state_menu(), S, '    ');
     }
     return O_BEGIN . rtrim(self::create($array, $type, $depth, $FP, 0), NL) . O_END;
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:9,代码来源:menu.php

示例6: array

$hooks = array($files, $segment);
?>
<div class="main-action-group">
  <?php 
Weapon::fire('main_action_before', $hooks);
?>
  <?php 
echo Jot::btn('begin:plus-square', Config::speak('manager.title_new_', $speak->menu), $config->manager->slug . '/menu/ignite');
?>
  <?php 
Weapon::fire('main_action_after', $hooks);
?>
</div>
<?php 
echo $messages;
$files_all = Get::state_menu(null, array());
ksort($files_all);
if ($files_all) {
    ?>
<table class="table-bordered table-full-width">
  <thead>
    <tr>
      <th><?php 
    echo $speak->menu;
    ?>
</th>
      <th class="text-center" colspan="2"><?php 
    echo $speak->action;
    ?>
</th>
    </tr>
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:cargo.menu.php


注:本文中的Get::state_menu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。