コード例 #1
0
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)) . ' · ';
}
コード例 #2
0
ファイル: widget.php プロジェクト: razordaze/mecha-cms
 /**
  * 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));
     }
 }
コード例 #3
0
    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));
});
コード例 #4
0
ファイル: repair.post.php プロジェクト: AdeHaze/mecha-cms
?>
<div class="tab-area">
  <div class="tab-button-area">
    <?php 
Weapon::fire('tab_button_before', $hooks);
?>
    <a class="tab-button active" href="#tab-content-1"><?php 
echo Jot::icon('pencil', 'fw') . ' ' . $speak->compose;
?>
</a>
    <a class="tab-button" href="#tab-content-2"><?php 
echo Jot::icon('leaf', 'fw') . ' ' . $speak->manager->title_css_and_js_custom;
?>
</a>
    <a class="tab-button" href="#tab-content-3"><?php 
echo Jot::icon('th-list', 'fw') . ' ' . $speak->fields;
?>
</a>
    <?php 
Weapon::fire('tab_button_after', $hooks);
?>
  </div>
  <div class="tab-content-area">
    <?php 
echo $messages;
?>
    <form class="form-<?php 
echo $page->id ? 'repair' : 'ignite';
?>
 form-<?php 
echo $segment;
コード例 #5
0
ファイル: repair.plugin.php プロジェクト: razordaze/mecha-cms
  <p><?php 
    echo Config::speak('notify_not_available', $speak->config);
    ?>
</p>
  <?php 
}
?>
  </div>
  <div class="tab-content hidden" id="tab-content-2">
    <p class="about-author">
    <?php 
echo Cell::strong($speak->author . ':') . ' ' . Text::parse($file->author, '->encoded_html');
if (isset($file->url) && $file->url !== '#') {
    ?>
 <?php 
    echo Cell::a($file->url, Jot::icon('external-link-square'), '_blank', array('class' => array('about-url', 'help'), 'title' => $speak->link, 'rel' => 'nofollow'));
    ?>
    <?php 
}
?>
    </p>
    <h3 class="about-title"><?php 
echo $file->title;
if (isset($file->version)) {
    ?>
 <code class="about-version"><?php 
    echo $file->version;
    ?>
</code><?php 
}
?>
コード例 #6
0
', '<?php 
        echo $e === 'php' ? 'include' : 'print';
        ?>
');" title="<?php 
        echo $speak->shortcode;
        ?>
"><?php 
        echo Jot::icon($e === 'php' ? 'file-code-o' : 'file-o', 'fw') . ' ' . $_file;
        ?>
</a></td>
            <td class="td-icon"><?php 
        echo Jot::a('construct', $config->manager->slug . '/asset/repair/file:__snippet/' . $e . '/' . $_file, Jot::icon('pencil'), array('title' => $speak->edit));
        ?>
</td>
            <td class="td-icon"><?php 
        echo Jot::a('destruct', $config->manager->slug . '/asset/kill/file:__snippet/' . $e . '/' . $_file, Jot::icon('times'), array('title' => $speak->delete));
        ?>
</td>
          </tr>
          <?php 
    }
    ?>
        </tbody>
      </table>
      <?php 
}
?>
      <p><?php 
echo Jot::btn('action:database', $speak->snippets, $config->manager->slug . '/asset?path=__snippet');
?>
</p>
コード例 #7
0
ファイル: kill.shield.php プロジェクト: yiannisSt/mecha-cms
<?php

$hooks = array($page, $segment);
echo $messages;
?>
<h3><?php 
echo $speak->shield . ': ' . $page->title;
?>
</h3>
<?php 
if (strpos($config->url_path, '/kill/file:') !== false) {
    ?>
<p><?php 
    echo Cell::strong($folder) . ' ' . Jot::icon('arrow-right') . ' ' . str_replace(DS, ' ' . Jot::icon('arrow-right') . ' ', $path);
    ?>
</p>
<pre><code><?php 
    echo Text::parse(File::open(SHIELD . DS . $folder . DS . $path)->read(), '->encoded_html');
    ?>
</code></pre>
<?php 
} else {
    if ($files) {
        ?>
<ul>
  <?php 
        foreach ($files as $file) {
            ?>
  <li><?php 
            echo $file->path;
            ?>
コード例 #8
0
ファイル: widget.php プロジェクト: yiannisSt/mecha-cms
     $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));
コード例 #9
0
ファイル: cargo.asset.php プロジェクト: razordaze/mecha-cms
$c_path = ASSET . DS;
$c_url = $config->manager->slug . '/asset';
$c_url_kill = $c_url . '/kill/file:';
$c_url_repair = $c_url . '/repair/file:';
?>
<div class="tab-area">
  <a class="tab active" href="#tab-content-1"><?php 
echo Jot::icon('file-o', 'fw') . ' ' . $speak->file;
?>
</a>
  <a class="tab" href="#tab-content-2"><?php 
echo Jot::icon('folder', 'fw') . ' ' . $speak->folder;
?>
</a>
  <a class="tab" href="#tab-content-3"><?php 
echo Jot::icon('cloud-upload', 'fw') . ' ' . $speak->upload;
?>
</a>
</div>
<div class="tab-content-area">
  <?php 
echo $messages;
?>
  <div class="tab-content" id="tab-content-1">
    <h3><?php 
echo Config::speak('manager.title_your_', $speak->assets);
?>
</h3>
    <form class="form-kill form-asset" id="form-kill" action="<?php 
echo $config->url . '/' . $c_url . '/kill';
?>
コード例 #10
0
ファイル: cargo.field.php プロジェクト: razordaze/mecha-cms
</td>
      <?php 
            $s = Mecha::alter($value->type[0], array('t' => 'Text', 'b' => 'Boolean', 'o' => 'Option', 'f' => 'File', 'c' => 'Composer', 'e' => 'Editor'), 'Summary');
            ?>
      <td><?php 
            echo Jot::em('info', $s);
            ?>
</td>
      <td class="td-icon">
      <?php 
            echo Jot::a('construct', $config->manager->slug . '/field/repair/key:' . $key, Jot::icon('pencil'), array('title' => $speak->edit));
            ?>
      </td>
      <td class="td-icon">
      <?php 
            echo Jot::a('destruct', $config->manager->slug . '/field/kill/key:' . $key, Jot::icon('times'), array('title' => $speak->delete));
            ?>
      </td>
    </tr>
    <?php 
        }
        ?>
    <?php 
    }
    ?>
  </tbody>
</table>
<?php 
} else {
    ?>
<p><?php 
コード例 #11
0
 foreach ($fields as $key => $value) {
     // <= 1.1.3
     // "" is equal to `article,page`
     // '*' is equal to all scopes
     if ($value['scope'] === "") {
         $value['scope'] = 'article,page';
     }
     if ($value['scope'] === '*') {
         $value['scope'] = $segment;
     }
     if (isset($field[$key]['type'])) {
         $field[$key] = isset($field[$key]['value']) ? $field[$key]['value'] : "";
     }
     $type = $value['type'][0];
     if (strpos(',' . $value['scope'] . ',', ',' . $segment . ',') !== false) {
         $description = isset($value['description']) && trim($value['description']) !== "" ? ' <span class="text-info help" title="' . Text::parse($value['description'], '->encoded_html') . '">' . Jot::icon('question-circle') . '</span>' : "";
         $title = $value['title'] . $description;
         $html .= Form::hidden('fields[' . $key . '][type]', $type);
         if ($type === 't') {
             $html .= '<label class="grid-group grid-group-text">';
             $html .= '<span class="grid span-2 form-label">' . $title . '</span>';
             $html .= '<span class="grid span-4">';
             $html .= Form::text('fields[' . $key . '][value]', Converter::toText(isset($field[$key]) ? $field[$key] : $value['value']), Converter::toText(isset($value['placeholder']) ? $value['placeholder'] : $value['value']), array('class' => 'input-block'));
             $html .= '</span>';
             $html .= '</label>';
         } else {
             if ($type === 'b') {
                 $html .= '<div class="grid-group grid-group-boolean">';
                 $html .= '<span class="grid span-2"></span>';
                 $html .= '<span class="grid span-4">';
                 $html .= Form::checkbox('fields[' . $key . '][value]', !empty($value['value']) ? $value['value'] : '1', isset($field[$key]) && !empty($field[$key]), $value['title']) . $description;
コード例 #12
0
ファイル: kill.response.php プロジェクト: AdeHaze/mecha-cms
echo $messages;
$post = call_user_func('Get::' . $segment[1] . 'Anchor', $page->post);
?>
<h3><?php 
echo $page->name;
echo $post ? ' &raquo; <a href="' . $page->permalink . '" target="_blank">' . $post->title . '</a>' : "";
?>
</h3>
<?php 
echo $page->message;
?>
<p><time class="text-fade" datetime="<?php 
echo $page->date->W3C;
?>
"><?php 
echo Jot::icon('clock-o') . ' ' . $page->date->FORMAT_3;
?>
</time></p>
<form class="form-kill form-<?php 
echo $segment[0];
?>
" id="form-kill" action="<?php 
echo $config->url_current . str_replace('&', '&amp;', $config->url_query);
?>
" method="post">
  <?php 
Weapon::fire('action_before', $hooks);
?>
  <?php 
echo Jot::button('action', $speak->yes);
?>
コード例 #13
0
ファイル: kill.shield.php プロジェクト: razordaze/mecha-cms
<?php

echo $messages;
?>
<h3><?php 
echo $speak->shield . ': ' . $the_info['title'];
?>
</h3>
<?php 
if (strpos($config->url_path, '/kill/file:') !== false) {
    ?>
<p><?php 
    echo Cell::strong($the_shield) . ' ' . Jot::icon('arrow-right') . ' ' . str_replace(DS, ' ' . Jot::icon('arrow-right') . ' ', $the_name);
    ?>
</p>
<pre><code><?php 
    echo Text::parse(File::open(SHIELD . DS . $the_shield . DS . $the_name)->read(), '->encoded_html');
    ?>
</code></pre>
<?php 
} else {
    if ($files) {
        ?>
<ul>
  <?php 
        foreach ($files as $file) {
            ?>
  <li><?php 
            echo $file->path;
            ?>
</li>
コード例 #14
0
$count = 0;
$hooks = array($files, $segment);
echo $messages;
?>
<form class="form-repair form-shortcode" id="form-repair" action="<?php 
echo $config->url_current;
?>
" method="post">
  <?php 
echo Form::hidden('token', $token);
?>
  <table class="table-bordered table-full-width table-sortable">
    <thead>
      <tr>
        <th class="th-icon"><?php 
echo Jot::icon('sort');
?>
</th>
        <th><?php 
echo $speak->key;
?>
</th>
        <th><?php 
echo $speak->value;
?>
</th>
      </tr>
    </thead>
    <tbody>
      <?php 
if ($files) {
コード例 #15
0
ファイル: cargo.shield.php プロジェクト: razordaze/mecha-cms
">
      <?php 
            if ($c) {
                ?>
      <div class="media-capture" style="background-image:url('<?php 
                echo File::url($c);
                ?>
?v=<?php 
                echo filemtime($c);
                ?>
');" role="image"></div>
      <?php 
            }
            ?>
      <h4 class="media-title"><?php 
            echo Jot::icon('shield') . ' ' . $info->title;
            ?>
</h4>
      <div class="media-content">
        <p><?php 
            echo Converter::curt($info->content);
            ?>
</p>
        <p>
          <?php 
            echo Jot::btn('construct.small:cog', $speak->manage, $config->manager->slug . '/shield/' . $folder);
            ?>
 <?php 
            if (File::exist(SHIELD . DS . $folder . DS . 'manager.php')) {
                echo Jot::btn('action.small:shield', $speak->attach, $config->manager->slug . '/shield/attach/id:' . $folder);
                ?>
コード例 #16
0
ファイル: new.php プロジェクト: yiannisSt/mecha-cms
<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>
コード例 #17
0
      <?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>
コード例 #18
0
ファイル: cargo.tag.php プロジェクト: yiannisSt/mecha-cms
            ?>
      </td>
      <td class="td-icon">
      <?php 
            echo Jot::a('destruct', $config->manager->slug . '/tag/kill/id:' . $key, Jot::icon('times'), array('title' => $speak->delete));
            ?>
      </td>
      <?php 
        } else {
            ?>
      <td class="td-icon"><?php 
            echo Jot::icon('pencil');
            ?>
</td>
      <td class="td-icon"><?php 
            echo Jot::icon('times');
            ?>
</td>
      <?php 
        }
        ?>
    </tr>
    <?php 
    }
    ?>
  </tbody>
</table>
<?php 
} else {
    ?>
<p><?php 
コード例 #19
0
ファイル: cargo.shield.php プロジェクト: AdeHaze/mecha-cms
">
        <?php 
            if ($c) {
                ?>
        <div class="media-capture" style="background-image:url('<?php 
                echo File::url($c);
                ?>
?v=<?php 
                echo filemtime($c);
                ?>
');" role="image"></div>
        <?php 
            }
            ?>
        <h4 class="media-title"><?php 
            echo Jot::icon('shield') . ' ' . $page->title;
            ?>
</h4>
        <div class="media-content">
          <?php 
            if (preg_match('#<blockquote(>| .*?>)\\s*([\\s\\S]*?)\\s*<\\/blockquote>#', $page->content, $matches)) {
                $curt = Text::parse($matches[2], '->text', WISE_CELL_I);
                // get first blockquote content as description
            } else {
                $curt = Converter::curt($page->content);
            }
            ?>
          <p><?php 
            echo $curt;
            ?>
</p>
コード例 #20
0
ファイル: jot.php プロジェクト: razordaze/mecha-cms
    if (!isset($attr['class'])) {
        $attr['class'] = array();
    }
    $attr['class'] = array_merge(array('text-' . $kind), (array) $attr['class']);
    return Cell::unit('a', $text, $attr, $indent);
});
// File uploader
Jot::add('uploader', function ($action, $accept = null, $fields = array()) {
    $speak = Config::speak();
    $html = Cell::begin('form', array('class' => array('form-ignite', 'form-upload'), 'action' => Converter::url($action), 'method' => 'post', 'enctype' => 'multipart/form-data')) . NL;
    $html .= Form::hidden('token', Guardian::token(), array(), 1) . NL;
    foreach ($fields as $name => $value) {
        $html .= Form::hidden($name, $value, array(), 1) . NL;
    }
    $html .= Cell::begin('span', array('class' => array('input-outer', 'btn', 'btn-default')), 1) . NL;
    $html .= Cell::unit('span', Jot::icon('folder-open') . ' ' . $speak->manager->placeholder_file, array(), 2) . NL;
    $html .= Form::file('file', array('title' => $speak->manager->placeholder_file, 'data' => array('icon-ready' => 'fa fa-check', 'icon-error' => 'fa fa-times', 'accepted-extensions' => $accept)), 2) . NL;
    $html .= Cell::end() . ' ' . Jot::button('action:cloud-upload', $speak->upload) . NL;
    $html .= Cell::end();
    return $html;
});
// File finder
Jot::add('finder', function ($action, $name = 'q', $fields = array()) {
    $html = Cell::begin('form', array('class' => 'form-ignite form-find', 'action' => Converter::url($action), 'method' => 'get')) . NL;
    foreach ($fields as $key => $value) {
        $html .= Form::hidden($key, $value) . NL;
    }
    $html .= Form::text($name, Request::get($name, null), null, array(), 1) . ' ' . Jot::button('action:search', Config::speak('find')) . NL;
    $html .= Cell::end();
    return $html;
});
コード例 #21
0
</span>
        <span class="grid span-5">
          <?php 
if (Guardian::get('status') === 'pilot') {
    ?>
          <?php 
    echo Form::text('author', Guardian::wayback('author', $default->author));
    ?>
          <?php 
} else {
    ?>
          <?php 
    echo Form::hidden('author', $default->author);
    ?>
          <span class="form-static"><?php 
    echo Jot::icon('lock') . ' ' . $default->author;
    ?>
</span>
          <?php 
}
?>
        </span>
      </label>
      <?php 
Weapon::fire('unit_composer_1_after', array($segment));
?>
    </div>
    <div class="tab-content hidden" id="tab-content-2">
      <?php 
Weapon::fire('unit_composer_2_before', array($segment));
?>
コード例 #22
0
ファイル: launch.php プロジェクト: razordaze/mecha-cms
 * --------------
 */
if ($config->page_type === 'manager') {
    // Add default article footer link(s)
    Weapon::add('article_footer', function ($article) use($config, $speak) {
        $status = Mecha::alter(File::E($article->path), array('draft' => Jot::span('info', Jot::icon('clock-o') . ' ' . $speak->draft) . ' &middot; ', 'archive' => Jot::span('info', Jot::icon('history') . ' ' . $speak->archive) . ' &middot; '), "");
        echo $status . Cell::a($config->manager->slug . '/article/repair/id:' . $article->id, $speak->edit) . ' / ' . Cell::a($config->manager->slug . '/article/kill/id:' . $article->id, $speak->delete);
    }, 20);
    // Add default page footer link(s)
    Weapon::add('page_footer', function ($page) use($config, $speak) {
        $status = Mecha::alter(File::E($page->path), array('draft' => Jot::span('info', Jot::icon('clock-o') . ' ' . $speak->draft) . ' &middot; ', 'archive' => Jot::span('info', Jot::icon('history') . ' ' . $speak->archive) . ' &middot; '), "");
        echo $status . Cell::a($config->manager->slug . '/page/repair/id:' . $page->id, $speak->edit) . ' / ' . Cell::a($config->manager->slug . '/page/kill/id:' . $page->id, $speak->delete);
    }, 20);
    // Add default comment footer link(s)
    Weapon::add('comment_footer', function ($comment, $article) use($config, $speak) {
        $status = Mecha::alter($comment->state, array('pending' => 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)
 * ----------------------
 */
Weapon::add('shield_before', function () {
    $config = Config::get();
    $speak = Config::speak();
    $total = $config->total_comments_backend;
    $destination = SYSTEM . DS . 'log' . DS . 'comments.total.log';
    if ($file = File::exist($destination)) {
        $old = (int) File::open($file)->read();
        $total = $total > $old ? $total - $old : 0;
コード例 #23
0
ファイル: author.php プロジェクト: yiannisSt/mecha-cms
<label class="grid-group">
  <span class="grid span-1 form-label"><?php 
echo $speak->author;
?>
</span>
  <span class="grid span-5">
    <?php 
if (Guardian::happy(1)) {
    ?>
    <?php 
    echo Form::text('author', Request::get('author', Guardian::wayback('author', $page->author_raw)));
    ?>
    <?php 
} else {
    ?>
    <?php 
    echo Form::hidden('author', $page->author_raw);
    ?>
    <span class="form-static"><?php 
    echo Jot::icon('lock') . ' ' . $page->author_raw;
    ?>
</span>
    <?php 
}
?>
  </span>
</label>
コード例 #24
0
ファイル: cargo.plugin.php プロジェクト: yiannisSt/mecha-cms
">
        <?php 
        if ($c) {
            ?>
        <div class="media-capture" style="background-image:url('<?php 
            echo File::url($c);
            ?>
?v=<?php 
            echo filemtime($c);
            ?>
');" role="image"></div>
        <?php 
        }
        ?>
        <h4 class="media-title"><?php 
        echo Jot::icon(File::exist($r . 'pending.php') ? 'unlock-alt' : 'lock') . ' ' . $page->title;
        ?>
</h4>
        <div class="media-content">
          <?php 
        if (preg_match('#<blockquote(>| .*?>)\\s*([\\s\\S]*?)\\s*<\\/blockquote>#', $page->content, $matches)) {
            $curt = Text::parse($matches[2], '->text', '<abbr><sub><sup>');
            // get first blockquote content as description
        } else {
            $curt = Converter::curt($page->content);
        }
        ?>
          <p><?php 
        echo $curt;
        ?>
</p>
コード例 #25
0
ファイル: cargo.backup.php プロジェクト: yiannisSt/mecha-cms
    ?>
            </td>
          </tr>
          <?php 
}
?>
        </tbody>
      </table>
    </div>
    <div class="tab-content hidden" id="tab-content-2">
      <h3><?php 
echo $speak->restore;
?>
</h3>
      <?php 
$destinations = array(Jot::icon('file-text') . ' ' . $speak->article => ARTICLE, Jot::icon('file') . ' ' . $speak->page => PAGE, Jot::icon('magnet') . ' ' . $speak->extend => EXTEND, Jot::icon('comments') . ' ' . $speak->comment => COMMENT, Jot::icon('cogs') . ' ' . $speak->config => STATE, Jot::icon('briefcase') . ' ' . $speak->asset => ASSET, Jot::icon('shield') . ' ' . $speak->shield => SHIELD, Jot::icon('plug') . ' ' . $speak->plugin => PLUGIN);
?>
      <?php 
foreach ($destinations as $title => $destination) {
    ?>
      <div class="media no-capture">
        <h4 class="media-title"><?php 
    echo $title;
    ?>
</h4>
        <div class="media-content">
          <p><code><?php 
    echo $destination;
    ?>
</code></p>
          <?php 
コード例 #26
0
ファイル: preview.php プロジェクト: yiannisSt/mecha-cms
<a class="tab-button ajax-post" href="#tab-content-preview" data-action-url="<?php 
echo $config->url . '/' . $config->manager->slug . '/ajax/preview:' . File::url(str_replace(ROOT . DS, "", File::D(__DIR__, 3))) . '/' . (is_array($segment) ? $segment[0] : $segment);
?>
" data-text-progress="&lt;p&gt;<?php 
echo $speak->previewing;
?>
&hellip;&lt;/p&gt;" data-text-error="&lt;p&gt;<?php 
echo $speak->error;
?>
.&lt;/p&gt;" data-scope="#form-<?php 
echo $page->id ? 'repair' : 'ignite';
?>
" data-target="#form-<?php 
echo $page->id ? 'repair' : 'ignite';
?>
-preview"><?php 
echo Jot::icon('eye', 'fw') . ' ' . $speak->preview;
?>
</a>
コード例 #27
0
ファイル: kill.post.php プロジェクト: yiannisSt/mecha-cms
<p><?php 
    echo $page->description;
    ?>
</p>
<?php 
}
?>
<p><time class="text-fade" datetime="<?php 
echo $page->date->W3C;
?>
"><?php 
echo Jot::icon('clock-o') . ' ' . $page->date->FORMAT_3;
?>
</time><?php 
if (isset($page->total_comments)) {
    $t = Jot::icon('comments') . ' ' . $page->total_comments;
    ?>
 &middot; <?php 
    echo $page->total_comments === 0 ? Cell::span($t) : Cell::a($config->manager->slug . '/comment?filter=post%3A' . $page->id, $t);
}
?>
</p>
<?php 
if ($page->css) {
    ?>
<pre><code><?php 
    echo substr(Text::parse($page->css, '->encoded_html'), 0, $config->excerpt->length);
    if (strlen($page->css) > $config->excerpt->length) {
        echo $config->excerpt->suffix;
    }
    ?>
コード例 #28
0
ファイル: __launch.php プロジェクト: AdeHaze/mecha-cms
 * Footer Link(s)
 * --------------
 */
// Add default article footer link(s)
Weapon::add('article_footer', function ($article) use($config, $speak) {
    $e = File::E($article->path);
    $comments = count(glob(COMMENT . DS . Date::slug($article->id) . '_*_*.{txt,hold}', GLOB_NOSORT | GLOB_BRACE));
    $t = Jot::icon('comments') . ' ' . $comments;
    $tt = array('title' => $comments . ' ' . ($comments === 1 ? $speak->comment : $speak->comments));
    $comments = ($e === 'draft' || $comments === 0 ? Cell::span($t, $tt) : Cell::a($config->manager->slug . '/comment?filter=post%3A' . $article->id, $t, null, $tt)) . ' &middot; ';
    $status = Mecha::alter($e, array('draft' => Jot::span('info', Jot::icon('clock-o') . ' ' . $speak->draft) . ' &middot; ', 'archive' => Jot::span('info', Jot::icon('history') . ' ' . $speak->archive) . ' &middot; '), "");
    echo $comments . $status . Cell::a($config->manager->slug . '/article/repair/id:' . $article->id, $speak->edit) . ' / ' . Cell::a($config->manager->slug . '/article/kill/id:' . $article->id, $speak->delete);
}, 20);
// Add default page footer link(s)
Weapon::add('page_footer', function ($page) use($config, $speak) {
    $status = Mecha::alter(File::E($page->path), array('draft' => Jot::span('info', Jot::icon('clock-o') . ' ' . $speak->draft) . ' &middot; ', 'archive' => Jot::span('info', Jot::icon('history') . ' ' . $speak->archive) . ' &middot; '), "");
    echo $status . Cell::a($config->manager->slug . '/page/repair/id:' . $page->id, $speak->edit) . ' / ' . Cell::a($config->manager->slug . '/page/kill/id:' . $page->id, $speak->delete);
}, 20);
/**
 * Backend Route(s)
 * ----------------
 *
 * Load the routes.
 *
 */
Weapon::add('plugins_after', function () use($config, $speak, $segment) {
    // loading cargo ...
    require __DIR__ . DS . 'workers' . DS . 'cargo.php';
    if ($detour = File::exist(__DIR__ . DS . 'workers' . DS . 'route.' . $segment . '.php')) {
        require $detour;
    }
コード例 #29
0
ファイル: launch.php プロジェクト: AdeHaze/mecha-cms
         // 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;
コード例 #30
0
<form class="form-plugin" action="<?php 
echo $config->url_current;
?>
/update" method="post">
  <?php 
echo Form::hidden('token', $token);
?>
  <div class="tab-area">
    <div class="tab-button-area">
      <a class="tab-button active" href="#tab-content-1-1"><?php 
echo Jot::icon('comments-o', 'fw') . ' ' . $speak->activate;
?>
</a>
      <a class="tab-button" href="#tab-content-1-2"><?php 
echo Jot::icon('cogs', 'fw') . ' ' . $speak->configs;
?>
</a>
    </div>
    <div class="tab-content-area">
      <div class="tab-content" id="tab-content-1-1">
        <?php 
$comment_service_config = File::open(__DIR__ . DS . 'states' . DS . 'config.txt')->unserialize();
$options = array();
foreach (glob(__DIR__ . DS . 'workers' . DS . '*', GLOB_ONLYDIR) as $option) {
    $option = File::B($option);
    $options[$option] = isset($speak->plugin_comment_service->title->{$option}) ? $speak->plugin_comment_service->title->{$option} : Text::parse($option, '->title');
}
?>
        <p><?php 
echo Form::select('service', $options, $comment_service_config['service']);
?>