\Current

Current Utilityチェック

NetCommonsの機能として必要な情報を保持します。
NetCommonsAppController::beforeFilter で初期処理が呼び出され、値が設定されます。
値を取得する時は、readメソッドを使用します。
権限を取得する時は、permissionメソッドを使用します。

保持データ

Array(
    [User] => Array(
        [id] => 1
        [username] => admin
        [key] => 640f981d6104fd21463d674f18477348
        [avatar] =>
        [avatar_file_id] =>
        [is_avatar_public] =>
        [handlename] => admin
        [is_handlename_public] =>
        [is_name_public] =>
        [email] =>
        [is_email_public] =>

        ・・・

        [Role] => Array(
            [id] => 1
            [language_id] => 2
            [key] => system_administrator
            [type] => 1
            [name] => システム管理者
            [is_system] => 1
        )
    )

    [Language] => Array(
        [id] => 2
        [code] => ja
        [weight] => 2
        [is_active] => 1
    )

    [PluginsRole] => Array(
        [13] => Array(
            [id] => 13
            [role_key] => system_administrator
            [plugin_key] => rooms
        )

        [20] => Array(
            [id] => 20
            [role_key] => system_administrator
            [plugin_key] => user_manager
        )

    )

    [Page] => Array(
        [id] => 1
        [room_id] => 1
        [parent_id] =>
        [lft] => 1
        [rght] => 2
        [permalink] =>
        [slug] =>
        [is_published] => 1
        [from] =>
        [to] =>
        [is_container_fluid] =>
    )

    [Room] => Array(
        [id] => 1
        [space_id] => 2
        [page_id_top] => 1
        [root_id] =>
        [parent_id] =>
        [lft] => 1
        [rght] => 2
        [active] => 1
        [default_role_key] => visitor
        [need_approval] => 1
        [default_participation] => 1
        [page_layout_permitted] => 1
    )

    [ParentPage] => Array(
        ・・・
    )

    [RolesRoomsUser] => Array(
        ・・・
    )

    [RolesRoom] => Array(
        ・・・
    )

・・・

    [Permission] => Array(
        [page_editable] => Array(
            [id] => 9
            [role_key] => room_administrator
            [type] => room_role
            [permission] => page_editable
            [value] => 1
            [fixed] => 1
            [roles_room_id] => 1
        )

        [block_editable] => Array(
            ・・・
        )

        [content_readable] => Array(
            ・・・
        )

        [content_creatable] => Array(
            ・・・
        )

        [content_editable] => Array(
            ・・・
        )

        [content_publishable] => Array(
            ・・・
        )

        [content_comment_creatable] => Array(
            ・・・
        )

        [content_comment_editable] => Array(
            ・・・
        )

        [content_comment_publishable] => Array(
            ・・・
        )

        [block_permission_editable] => Array(
            ・・・
        )

        [html_not_limited] => Array(
            ・・・
        )

    )

    [Plugin] => Array(
        [id] => 5
        [language_id] => 2
        [key] => announcements
        [name] => お知らせ
        [namespace] => netcommons/announcements
        [weight] =>
        [type] => 1
        [default_action] => announcements/view
        [default_setting_action] => announcement_blocks/index
    )

    [Frame] => Array(
        [id] => 1
        [language_id] => 2
        [room_id] => 1
        [box_id] => 3
        [plugin_key] => announcements
        [block_id] => 1
        [key] => frame_1
        [name] => お知らせ
        [header_type] => default
        [translation_engine] =>
        [is_first_auto_translation] =>
        [is_auto_translated] =>
        [weight] => 1
        [is_deleted] =>
    )

    [Box] => Array(
        [id] => 3
        [container_id] => 3
        [type] => 4
        [space_id] =>
        [room_id] => 1
        [page_id] => 1
        [weight] => 1
    )

    [Block] => Array(
        [id] => 1
        [language_id] => 2
        [room_id] => 1
        [plugin_key] => announcements
        [key] => block_1
        [name] => NetCommons 3! セッティングモードで編集しよう.
        [public_type] => 1
        [from] =>
        [to] =>
        [translation_engine] =>
        [is_auto_translated] =>
        [is_first_auto_translation] =>
    )
)

Summary

Methods
Properties
Constants
read()
write()
remove()
permission()
initialize()
readM17n()
isLogin()
isSettingMode()
hasSettingMode()
isControlPanel()
hasControlPanel()
allowSystemPlugin()
$current
$request
$m17n
SETTING_MODE_WORD
PLUGIN_USERS
PLUGIN_GROUPS
PLUGIN_WYSIWYG
PLUGIN_PAGES
No protected methods found
$_isSettingMode
$_instance
N/A
No private methods found
No private properties found
N/A

Constants

SETTING_MODE_WORD

SETTING_MODE_WORD

Constant setting mode value

PLUGIN_USERS

PLUGIN_USERS

Usersプラグイン名の定数

PLUGIN_GROUPS

PLUGIN_GROUPS

Groupsプラグイン名の定数

PLUGIN_WYSIWYG

PLUGIN_WYSIWYG

Wysiwygプラグイン名の定数

PLUGIN_PAGES

PLUGIN_PAGES

Pagesプラグイン名の定数

Properties

$current

$current : array

Current data

Type

array

$request

$request : mixed

Request object

Type

mixed

$m17n

$m17n : array

M17n data

Type

array

$_isSettingMode

$_isSettingMode : boolean

is setting mode true

Type

boolean

$_instance

$_instance : mixed

Instance object

Type

mixed

Methods

read()

read(string|null  $key = null, mixed  $default = null) : array|null

指定された$keyの値を返します。

現在のBlockKeyを取得したい場合

Cuurent::read('Block.key')

Parameters

string|null $key

Hashクラスのpath

mixed $default

デフォルト値

Returns

array|null —

Current data.

write()

write(string|null  $key, \mixted  $value) : void

指定された$keyの値をセットします

現在のBlockKeyをセットしたい場合

Cuurent::write('Block.key', 'block_key)

Parameters

string|null $key

Hashクラスのpath、nullの場合、Hash::mergeする

\mixted $value

セットする値

remove()

remove(string|null  $key = null) : array|null

指定された$keyの値を削除します。

現在のBlockKeyを削除したい場合

Cuurent::remove('Block.key')

Parameters

string|null $key

Hashクラスのpath

Returns

array|null —

Current data.

permission()

permission(string  $key) : boolean

指定された$key(権限名文字列)の値を返します。

Current::permission('content_publishable')

Parameters

string $key

Hashクラスのpath

Returns

boolean —

permission value

initialize()

initialize(\CakeRequest  $request) : void

setup current data

Parameters

\CakeRequest $request

CakeRequest

readM17n()

readM17n(string|null  $languageId, string|null  $model = null, string|null  $field = null) : mixed

多言語のデータ取得

Parameters

string|null $languageId

言語ID

string|null $model

モデル名

string|null $field

フィールド名

Returns

mixed —

Currentデータ

isLogin()

isLogin() : boolean

ログインチェック

Returns

boolean

isSettingMode()

isSettingMode(boolean|null  $settingMode = null) : boolean

セッティングモードチェック

Parameters

boolean|null $settingMode

セッティングモードの状態変更

Returns

boolean

hasSettingMode()

hasSettingMode() : boolean

セッティングモードの有無

Returns

boolean

isControlPanel()

isControlPanel() : boolean

コントロールパネルチェック

Returns

boolean

hasControlPanel()

hasControlPanel() : boolean

コントロールパネルの有無

Returns

boolean

allowSystemPlugin()

allowSystemPlugin(string  $pluginKey) : boolean

管理系プラグインの許可

Parameters

string $pluginKey

プラグインkey

Returns

boolean