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


PHP Jot类代码示例

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


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

示例1: __do_response_reply_count

function __do_response_reply_count($response)
{
    global $config, $speak, $segment;
    $e = File::E($response->path);
    $replies = count(glob(COMMENT . DS . '*_*_' . Date::slug($response->id) . '.{txt,hold}', GLOB_NOSORT | GLOB_BRACE));
    $t = Jot::icon('reply-all') . ' ' . $replies;
    $tt = array('title' => $replies . ' ' . ($replies === 1 ? $speak->{$segment[0] . '_reply'} : $speak->{$segment[0] . '_replies'}));
    echo ($e === 'hold' || $replies === 0 ? Cell::span($t, $tt) : Cell::a($config->manager->slug . '/' . $segment[0] . '?filter=parent%3A' . $response->id, $t, null, $tt)) . ' · ';
}
开发者ID:tovic,项目名称:comment-reply-plugin-for-mecha-cms,代码行数:9,代码来源:__launch.php

示例2: manager

 /**
  * Widget Manager
  * --------------
  *
  * [1]. Widget::manager('MENU');
  * [2]. Widget::manager('BAR');
  *
  */
 public static function manager($type = 'MENU')
 {
     if (!Guardian::happy()) {
         return "";
     }
     $T1 = TAB;
     if ($type === 'MENU') {
         $menus = array();
         if ($_menus = Mecha::A(Config::get('manager_menu'))) {
             $_menus = Mecha::eat($_menus)->order('ASC', 'stack', true, 10)->vomit();
             foreach ($_menus as $k => $v) {
                 // < 1.1.3
                 if (is_string($v)) {
                     $menus[$k] = $v;
                 } else {
                     $stack = isset($v['stack']) ? $v['stack'] : 10;
                     $_k = (strpos($v['icon'], '<') === false ? '<i class="fa fa-fw fa-' . $v['icon'] . '"></i>' : $v['icon']) . ' <span class="label">' . $k . '</span>' . (isset($v['count']) && ($v['count'] === '&infin;' || (double) $v['count'] > 0) ? ' <span class="counter">' . $v['count'] . '</span>' : "");
                     $menus[$_k] = isset($v['url']) ? $v['url'] : null;
                 }
             }
         }
         $html = O_BEGIN . '<div class="widget widget-manager widget-manager-menu" id="widget-manager-menu-' . self::$id['manager_menu'] . '">' . NL;
         self::$id['manager_menu']++;
         $html .= Menu::get($menus, 'ul', $T1, 'manager:');
         $html .= '</div>' . O_END;
         $html = Filter::apply('widget', $html);
         return Filter::apply('widget:manager.menu', Filter::apply('widget:manager', $html));
     }
     if ($type === 'BAR') {
         $html = O_BEGIN . '<div class="widget widget-manager widget-manager-bar" id="widget-manager-bar-' . self::$id['manager_bar'] . '">' . NL;
         self::$id['manager_bar']++;
         $bars = array();
         if ($_bars = Mecha::A(Config::get('manager_bar'))) {
             $_bars = Mecha::eat($_bars)->order('ASC', 'stack', true, 10)->vomit();
             foreach ($_bars as $k => $v) {
                 if (is_string($v)) {
                     $bar = $v;
                 } else {
                     $t = ' data-tooltip="' . Text::parse(isset($v['description']) ? $v['description'] : $k, '->encoded_html') . '"';
                     $bar = isset($v['url']) ? '<a class="item" href="' . Converter::url($v['url']) . '"' . $t . '>' : '<span class="item a"' . $t . '>';
                     $bar .= isset($v['icon']) ? strpos($v['icon'], '<') === false ? Jot::icon($v['icon']) : $v['icon'] : $k;
                     $bar .= ' <span class="label">' . $k . '</span>';
                     if (isset($v['count']) && ($v['count'] === '&infin;' || (double) $v['count'] > 0)) {
                         $bar .= ' <span class="counter">' . $v['count'] . '</span>';
                     }
                     $bar .= isset($v['url']) ? '</a>' : '</span>';
                 }
                 $bars[] = Filter::apply('manager:bar.item', $bar);
             }
         }
         $html .= $T1 . Filter::apply('manager:bar', implode(' ', $bars)) . NL;
         $html .= '</div>';
         return Filter::apply('widget:manager.bar', Filter::apply('widget:manager', $html));
     }
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:63,代码来源:widget.php

示例3: md5

<?php

$c_editor = $config->states->{'plugin_' . md5(File::B(__DIR__))};
?>
<div class="p">
  <?php 
foreach ($speak->MTE->buttons as $k => $v) {
    ?>
  <?php 
    if (Text::check($k)->in(array('yes', 'no', 'ok', 'cancel', 'open', 'close'))) {
        continue;
    }
    ?>
  <div><?php 
    echo Form::checkbox('buttons[' . $k . ']', 1, isset($c_editor->buttons->{$k}), sprintf($speak->manager->title_show__button, $v));
    ?>
</div>
  <?php 
}
?>
</div>
<p><?php 
echo Jot::button('action', $speak->update);
?>
</p>
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:25,代码来源:configurator.php

示例4: function

         // include once ...
     }
 }, 20);
 Weapon::add('SHIPMENT_REGION_BOTTOM', function () use($config) {
     Session::kill('recent_item_update');
     $path = __DIR__ . DS . 'assets' . DS . 'sword' . DS;
     echo Asset::javascript(array($path . 'ajax.js', $path . 'row.js', $path . 'slug.js', $path . 'upload.js', $path . 'tab.js', $path . 'toggle.js', $path . 'modal.js', $path . 'tooltip.js', $path . 'sortable.js', $path . 'accordion.js', SHIELD . DS . $config->shield . DS . 'assets' . DS . 'sword' . DS . 'manager.js'), "", 'sword/manager.min.js');
 }, 1);
 /**
  * Footer Link(s)
  * --------------
  */
 if ($config->page_type === 'manager' || $config->is->post) {
     // Add default comment footer link(s)
     Weapon::add('comment_footer', function ($comment, $article) use($config, $speak) {
         $status = Mecha::alter(File::E($comment->path), array('hold' => Jot::span('info', Jot::icon('clock-o') . ' ' . $speak->pending) . ' &middot; '), "");
         echo $status . Cell::a($config->manager->slug . '/comment/repair/id:' . $comment->id, $speak->edit) . ' / ' . Cell::a($config->manager->slug . '/comment/kill/id:' . $comment->id, $speak->delete);
     }, 20);
 }
 /**
  * Widget Manager Menu(s) and Bar(s)
  * ---------------------------------
  *
  * [1]. Config::merge('manager_menu', array());
  * [2]. Config::merge('manager_bar', array());
  *
  */
 Weapon::add('shield_before', function () {
     $config = Config::get();
     $speak = Config::speak();
     $total = $config->__total_comments;
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:31,代码来源:launch.php

示例5: array

$path = File::url($path);
?>
  <?php 
if ($is_text && $content !== false) {
    ?>
  <p>
  <?php 
    echo Form::textarea('content', Request::get('content', Guardian::wayback('content', $content)), $speak->manager->placeholder_content, array('class' => array('textarea-block', 'textarea-expand', 'code')));
    ?>
  </p>
  <?php 
}
?>
  <p>
    <?php 
echo Form::hidden('name', $path);
?>
    <?php 
Weapon::fire('action_before', $hooks);
?>
    <?php 
echo Jot::button('action', $is_text ? $speak->update : $speak->rename);
?>
    <?php 
echo Jot::btn('destruct', $speak->delete, $config->manager->slug . '/cache/kill/file:' . $path);
?>
    <?php 
Weapon::fire('action_after', $hooks);
?>
  </p>
</form>
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:repair.cache.php

示例6: array_slice

    if (trim($request['name']) === "") {
        $request['name'] = $id . '.txt';
        // empty file name
    }
    $_path = Text::parse(sprintf($request['name'], $id), '->safe_path_name');
    $e = File::E($_path, false);
    if ($e !== 'txt' && $e !== 'php') {
        $e = 'txt';
        $_path .= '.txt';
    }
    $_path_ = File::path($_path);
    $file = ASSET . DS . '__snippet' . DS . $e . DS . $_path;
    if (File::exist($file)) {
        // file already exists
        Notify::error(Config::speak('notify_file_exist', '<code>' . $_path_ . '</code>'));
    }
    if (trim($request['content']) === "") {
        // empty file content
        Notify::error($speak->notify_error_content_empty);
    }
    if (!Notify::errors()) {
        $recent = array_slice(File::open(CACHE . DS . 'plugin.snippet.cache')->unserialize(), 0, $config->per_page);
        File::serialize(array_merge(array($_path), $recent))->saveTo(CACHE . DS . 'plugin.snippet.cache', 0600);
        $url = $config->manager->slug . '/asset/repair/file:__snippet/' . $e . '/' . File::url($_path) . '?path=' . urlencode(rtrim('__snippet/' . $e . '/' . File::D(File::url($_path)), '/'));
        File::write($request['content'])->saveTo($file, 0600);
        Notify::success(Config::speak('notify_file_created', '<code>' . $_path_ . '</code>' . (!isset($request['redirect']) ? ' <a class="pull-right" href="' . $config->url . '/' . $url . '" target="_blank">' . Jot::icon('pencil') . ' ' . $speak->edit . '</a>' : "")));
        Notify::info('<strong>' . $speak->shortcode . ':</strong> <code>{{' . ($e === 'php' ? 'include' : 'print') . ':' . str_replace('.' . $e . X, "", File::url($_path) . X) . '}}</code>');
        Guardian::kick(isset($request['redirect']) ? $url : File::D($config->url_current));
    }
    Guardian::kick(File::D($config->url_current));
});
开发者ID:tovic,项目名称:snippet-plugin-for-mecha-cms,代码行数:31,代码来源:route.snippet.php

示例7: array

$hooks = array($page, $segment);
echo $messages;
?>
<h3><?php 
echo $page->title;
?>
</h3>
<?php 
echo $page->content;
?>
<form class="form-kill form-plugin" id="form-kill" action="<?php 
echo $config->url_current . $config->url_query;
?>
" method="post">
  <?php 
Weapon::fire('action_before', $hooks);
?>
  <?php 
echo Jot::button('action', $speak->yes);
?>
  <?php 
echo Jot::btn('reject', $speak->no, $config->manager->slug . '/plugin');
?>
  <?php 
Weapon::fire('action_after', $hooks);
?>
  <?php 
echo Form::hidden('token', $token);
?>
</form>
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:30,代码来源:kill.plugin.php

示例8:

<fieldset>
  <legend>Disqus</legend>
  <label class="grid-group">
    <span class="grid span-1 form-label"><?php 
echo $speak->id . ' ' . Jot::info($speak->plugin_comment_service->description->disqus_id);
?>
</span>
    <span class="grid span-5"><?php 
echo Form::text('services[disqus][id]', $comment_service_config['services']['disqus']['id'], File::N($config->host));
?>
</span>
  </label>
</fieldset>
开发者ID:tovic,项目名称:comment-service-plugin-for-mecha-cms,代码行数:13,代码来源:configurator.php

示例9: array

$hooks = array($page, $segment);
echo $messages;
if ($content) {
    ?>
<p>
<?php 
    echo Form::textarea('content', Request::get('content', Guardian::wayback('content', $content)), $speak->manager->placeholder_content, array('class' => array('textarea-block', 'textarea-expand', 'code')));
    ?>
</p>
<p>
  <?php 
    Weapon::fire('action_before', $hooks);
    ?>
  <?php 
    echo Jot::btn('destruct', $speak->delete, $config->manager->slug . '/error/kill');
    ?>
  <?php 
    Weapon::fire('action_after', $hooks);
    ?>
</p>
<?php 
} else {
    ?>
<p><?php 
    echo Config::speak('notify_empty', strtolower($speak->errors));
    ?>
</p>
<p>
  <?php 
    Weapon::fire('action_before', $hooks);
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:30,代码来源:cargo.error.php

示例10: substr

    if (strlen($article->css) > $config->excerpt_length) {
        echo ' &hellip;';
    }
    ?>
</code></pre>
<?php 
}
if (!empty($article->js)) {
    ?>
<pre><code><?php 
    echo substr(Text::parse($article->js, '->encoded_html'), 0, $config->excerpt_length);
    if (strlen($article->js) > $config->excerpt_length) {
        echo ' &hellip;';
    }
    ?>
</code></pre>
<?php 
}
?>
<form class="form-kill form-article" id="form-kill" action="<?php 
echo $config->url_current . $config->url_query;
?>
" method="post">
<?php 
echo Jot::button('action', $speak->yes);
?>
 <?php 
echo Jot::btn('reject', $speak->no, $config->manager->slug . '/article/repair/id:' . $article->id);
echo Form::hidden('token', $token);
?>
</form>
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:kill.article.php

示例11:

    <span class="grid span-1"></span>
    <span class="grid span-5">
      <?php 
if ($id !== false) {
    ?>
      <?php 
    echo Jot::button('action', $speak->update);
    ?>
      <?php 
    echo Jot::btn('destruct', $speak->delete, $config->manager->slug . '/field/kill/key:' . $id);
    ?>
      <?php 
} else {
    ?>
      <?php 
    echo Jot::button('construct', $speak->create);
    ?>
      <?php 
}
?>
    </span>
  </div>
</form>
<script>
(function(w, d) {
    var form = d.getElementById('form-<?php 
echo $id !== false ? 'repair' : 'ignite';
?>
'),
        type = form.type,
        value = form.value,
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:31,代码来源:repair.field.php

示例12: array

     $bars = array();
     if ($_bars = Mecha::A(Config::get('manager_bar'))) {
         $_bars = Mecha::eat($_bars)->order('ASC', 'stack', true, 10)->vomit();
         foreach ($_bars as $k => $v) {
             if (is_string($v)) {
                 $bar = $v;
             } else {
                 $t = ' data-tooltip="' . Text::parse(isset($v['description']) ? $v['description'] : $k, '->encoded_html') . '"';
                 if (isset($v['url'])) {
                     $url = Filter::colon('manager:url', Converter::url($v['url']));
                     $c = $config->url_current === $url ? ' ' . Widget::$config['classes']['current'] : "";
                     $bar = '<a class="item' . $c . '" href="' . $url . '"' . $t . '>';
                 } else {
                     $bar = '<span class="item a"' . $t . '>';
                 }
                 $bar .= isset($v['icon']) ? strpos($v['icon'], '<') === false ? Jot::icon($v['icon']) : $v['icon'] : $k;
                 $bar .= ' <span class="label">' . $k . '</span>';
                 if (isset($v['count']) && ($v['count'] === '&infin;' || (double) $v['count'] > 0)) {
                     $bar .= ' <span class="counter">' . $v['count'] . '</span>';
                 }
                 $bar .= isset($v['url']) ? '</a>' : '</span>';
             }
             $bars[] = $bar;
         }
     }
     $html .= $T1 . implode(' ', $bars) . NL;
 }
 $html .= '</div>' . O_END;
 $html = Filter::apply('widget', $html);
 Config::set('widget_manager_' . $kin . '_id', $id);
 return Filter::apply('widget:manager.' . $kin, Filter::apply('widget:manager', $html));
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:widget.php

示例13: isset

      <?php 
        echo isset($c_url_repair) && $c_url_repair !== false ? Jot::a('construct', $c_url_repair . $url, Jot::icon('pencil'), array('title' => $speak->edit)) : Jot::icon('pencil');
        ?>
      </td>
      <td class="td-icon">
      <?php 
        echo isset($c_url_kill) && $c_url_kill !== false ? Jot::a('destruct', $c_url_kill . $url, Jot::icon('times'), array('title' => $speak->delete)) : Jot::icon('times');
        ?>
      </td>
    </tr>
    <?php 
    }
    ?>
    <?php 
} else {
    ?>
    <tr>
      <td class="td-icon"><?php 
    echo $config->offset === 1 ? Jot::icon('home') : Jot::a('action', $c_url, Jot::icon('home'));
    ?>
</td>
      <td><?php 
    echo Config::speak('notify_' . ($config->offset === 1 ? 'empty' : 'error_not_found'), strtolower($speak->files));
    ?>
</td>
    </tr>
    <?php 
}
?>
  </tbody>
</table>
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:unit.explorer.1.php

示例14:

<a class="tab-button" href="<?php 
echo $config->url . '/' . $config->manager->slug . '/' . $segment;
?>
/ignite" data-confirm-text="<?php 
echo $speak->notify_confirm_page_leave;
?>
"><?php 
echo Jot::icon('plus-square', 'fw') . ' ' . $speak->new;
?>
</a>
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:10,代码来源:new.php

示例15: strtolower

      <?php 
    }
    ?>
    </tbody>
    <?php 
} else {
    ?>
    <tbody>
      <tr>
        <td class="td-icon"><?php 
    echo $config->offset === 1 ? Jot::icon('home') : Jot::a('action', $cache_url, Jot::icon('home'));
    ?>
</td>
        <td><?php 
    echo Config::speak('notify_' . ($config->offset === 1 ? 'empty' : 'error_not_found'), strtolower($speak->files));
    ?>
</td>
      </tr>
    </tbody>
    <?php 
}
?>
  </table>
</form>
<?php 
if (!empty($pager->step->url) || Request::get('q')) {
    ?>
<hr>
<?php 
    echo Jot::finder($cache_url, 'q');
}
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:cargo.cache.php


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