Mecha CMS

Mecha CMS blog and documentation.

Version 1.1.5

Updated: Sunday, 07 August 2016

Changelog in Mecha 1.1.5.

Added

  • Method
    • File::B()
    • File::D()
    • File::E()
    • File::N()
    • File::T()
    • Text::check()
    • Text::has()
    • Text::in()
    • Text::offset()
    • Widget::manager('BAR') → default is MENU
  • JavaScript
    • DASHBOARD.url.protocol → is equal to $config->protocol
    • DASHBOARD.url.base → is equal to $config->base
    • DASHBOARD.url.host → is equal to $config->host
    • DASHBOARD.url.root → is equal to $config->url
    • DASHBOARD.url.path → is equal to $config->url_path
    • DASHBOARD.url.current → is equal to $config->url_current
    • DASHBOARD.url.query → is equal to $config->url_query
    • DASHBOARD.url.hash
    • DASHBOARD.task.slug(input) → is equal to Text::parse($input, '->slug')
    • DASHBOARD.task.session.*() → is equal to Session::*()
    • DASHBOARD.task.query()
    • DASHBOARD.task.file.[B,D,E,N]() → is equal to File::[B,D,E,N]()
    • DASHBOARD.task.extend() → is equal to Mecha::extend()
  • Filter
    • manager:bar
    • manager:bar.item
    • widget:manager.bar
  • Parser
    • to_broken_entity

Removed

  • Filter
    • author:banner
  • Parser
    • to_slug_moderate

Updated

  • Method
    • Cell::ol()
    • Cell::ul()
    • Form::select()
    • Get::articlePath()
    • Get::pagePath()
    • Guardian::ally()
    • Guardian::authorize()
    • Guardian::check()
    • Guardian::checker()
    • Guardian::checkerExist()
    • Guardian::kick()
    • Guardian::math()
    • Navigator::extract()
    • Plugin::load()
    • Text::parse()
    • Text::parser()
    • Text::parserExist()
    • Widget::*()
  • Parser
    • to_ascii

New Custom Field Type

File

A file uploader field, make it possible to upload attachment directly through the post editor.

Editor

A summary–like custom field, primarily used as a source code editor.

Composer

A summary–like custom field, primarily used as a sentence editor.

Description and Placeholder for Custom Field

Give users some clues about how to use and/or how to fill out the custom field with the description data that will produce a tiny help icon which you can hover over it to see the guide in a tooltip. Use placeholder to set the placeholder attribute value for text and summary custom field type:

'the_key' => array(
    'title' => 'The Title',
    'type' => 'text',
    'placeholder' => 'YYYY/MM/DD',
    'value' => 'Lorem ipsum dolor sit amet.',
    'description' => 'Use this custom field to …',
    'scope' => 'article'
)

Dynamic Option Custom Field

For the dynamic option custom field’s value, you can now use array instead of nested formating text:

'the_key' => array(
    'title' => 'Theme',
    'type' => 'option',
    'value' => array(
        'red' => 'Red',
        'green' => 'Green',
        'blue' => 'Blue',
        'yellow' => 'Yellow'
    )
)

Better Handling for Multiple Custom Field Scope

Before 1.1.5, we only rely on the scope of article, page, comment and article/page:

  • article → article
  • page → page
  • comment → comment
  • empty → is equal to article and page
  • * or not set → is equal to all scopes

In 1.1.5, simply separate each scope you want to add with comma:

array(
    'scope' => 'article,page,comment'
)

Text Parser and Input Validator Key

Output keys of text parsers and input validators are now lower–cased for consistency. For the indirect output mode, they are case insensitive:

if(Guardian::check('abc')->this_is_URL) { /* no! */ }
if(Guardian::check('abc')->this_is_url) { /* ok! */ }
if(Guardian::check('abc', '->URL')) { /* ok! */ }
if(Guardian::check('abc', '->url')) { /* ok! */ }

Cleaner Custom Field Data

Before 1.1.3, custom fields with empty values are stored in the page file. Custom field’s types are also stored in the page file.

Title: Test Article
Description: "Test article description."
Author: Taufik Nurrohman
Content Type: Markdown
Fields: {"field_1":{"type":"text","value":""},"field_2":{"type":"boolean"},"field_3":{"type":"summary","value":"test value"},"field_4":{"type:"option","value":"red"}}

In 1.1.3, custom fields with empty values are removed from the page file. Custom field’s types are stored in the page file, but minified.

Title: Test Article
Description: "Test article description."
Author: Taufik Nurrohman
Content Type: Markdown
Fields: {"field_3":{"type":"s","value":"test value"},"field_4":{"type:"o","value":"red"}}

After 1.1.3, custom fields data are now contains only keys and values.

Title: Test Article
Description: "Test article description."
Author: Taufik Nurrohman
Content Type: Markdown
Fields: {"field_3":"test value","field_4":"red"}

File Structure

Start from version 1.1.5, it is advisable to wrap the shell, sword and object folders within an assets folder:

root-folder/
├── assets/
│   ├── shell/
│   ├── sword/
│   └── object/
├── workers/
│   ├── fields.php
│   └── shortcodes.php
├── languages/
│   ├── en_US
│   └── id_ID
└── states/

Layout Update

Added About tab on the shield manager page. This forces me to unify the .plugin-* class names to .about-* for consistency:

Before 1.1.5, no specification:

.plugin-title {}
.plugin-author {}
.plugin-description {}

After 1.1.5, class names will follow the about.txt file’s header data:

.about-title {}
.about-author {}
.about-url {}
.about-version {}
.about-content {}

Math Captcha

You can now specify custom output for the math captcha to make it more difficult to be guessed by intruders like this:

echo Guardian::math(1, 10, array(
    1 => 'unul',
    2 => 'two',
    3 => 3,
    4 => '四',
    5 => 'пять',
    6 => 'sikisi',
    7 => 7,
    8 => 'walo',
    9 => 'есөн',
    10 => 'δέκα',
    '-' => 'minus',
    '+' => 'plus'
));

Download Mecha v1.1.5

Donation and Email Subscription