PHP Class BcAppController

Inheritance: extends Controller
Exibir arquivo Open project: baserproject/basercms

Public Properties

Property Type Description
$adminTheme string 管理画面テーマ
$components array コンポーネント
$content array コンテンツデータ
$contentsTitle string コンテンツタイトル
$crumbs array パンくずナビ
$help string ヘルプ
$helpers TODO 見直し
$layout string レイアウト
$pageTitle string ページタイトル
$preview boolean プレビューフラグ
$search string 検索ボックス
$site array サイトデータ
$siteConfigs array サイトコンフィグデータ
$siteDescription string ページ説明文
$subDir string サブディレクトリ
$subMenuElements string サブメニューエレメント
$uses mixed モデル
$viewClass string view

Public Methods

Method Description
__construct ( CakeRequest $request = null, CakeResponse $response = null ) コンストラクタ
_blackHoleCallback ( string $err ) : void Securityコンポーネントのブラックホールからのコールバック
admin_ajax_batch ( ) : void 一括処理
admin_ajax_get_token ( ) : string admin用Token取得アクション
admin_ajax_save_favorite_box ( mixed $open = '' ) : void よく使う項目の表示状態を保存する
admin_ajax_save_search_box ( string $key, mixed $open = '' ) : void 検索ボックスの表示状態を保存する
beforeFilter ( ) : void beforeFilter
beforeRender ( ) : void beforeRender
dispatchEvent ( string $name, array $params = [], array $options = [] ) : mixed イベントを発火
isAuthorized ( array $user ) : boolean 認証完了後処理
redirect ( mixed $url, integer $status = null, boolean $exit = true ) : mixed Redirects to given $url, after turning off $this->autoRender.
referer ( string $default = null, boolean $local = false ) : string Returns the referring URL for this request.
requestAction ( mixed $url, array $extra = [] ) : mixed Calls a controller's method from any location.
setAction ( string $action ) : mixed Internally redirects one action to another. Examples:

Protected Methods

Method Description
_adminSslMethods ( string $var ) : boolean 管理画面用のメソッドを取得(コールバックメソッド)
_autoConvertEncodingByArray ( array $data, string $outenc ) : array 配列の文字コードを変換する
_checkReferer ( ) : boolean リファラチェックを行う
_checkSubmitToken ( ) リクエストメソッドとトークンをチェックする
_loadViewConditions ( array $filterModels = [], array | string $options = [] ) : void 画面の情報をセッションから読み込む
_saveViewConditions ( array $filterModels = [], array $options = [] ) : void 画面の情報をセッションに保存する
_sslFail ( string $err ) : void SSLエラー処理
ajaxError ( integer $errorNo = 500, mixed $message = '' ) : void Ajax用のエラーを出力する
convertBetweenCondition ( string $fieldName, mixed $value ) : array BETWEEN 条件を生成
convertSelectTextCondition ( string $fieldName, mixed $values, array $options = [] ) : string Select Text 用の条件を生成する
generatePassword ( integer $len = 8 ) : string ランダムなパスワード文字列を生成する
getBaserVersion ( string $plugin = '' ) : string baserCMSのバージョンを取得する
getCakeVersion ( ) : string CakePHPのバージョンを取得する
getSiteVersion ( string $plugin = '' ) : string DBのバージョンを取得する
getThemeVersion ( string $theme ) : string テーマのバージョン番号を取得する
getToken ( ) : string Token の key を取得 CSRF対策のためにフォームのトークンを入手するためのもの adminと表画面でアクションを分離するために、取得部分を共通化
getUserModel ( ) : mixed リクエストされた画面に対しての認証用ユーザーモデルを取得する
notFound ( ) : void NOT FOUNDページを出力する
sendMail ( string $to, string $title = '', mixed $body = '', array $options = [] ) : boolean メールを送信する
setMessage ( string $message, boolean $alert = false, boolean $saveDblog = false, boolean $setFlash = true ) : void メッセージをビューにセットする
setTheme ( ) : void テーマをセットする
setThemeHelpers ( ) : void テーマ用のヘルパーをセットする 管理画面では読み込まない
setViewConditions ( array $filterModels = [], array $options = [] ) : void 画面の情報をセットする

Private Methods

Method Description
__convertEncodingHttpInput ( ) : void http経由で送信されたデータを変換する とりあえず、UTF-8で固定
__loadDataToView ( ) : void View用のデータを読み込む。 beforeRenderで呼び出される
__updateFirstAccess ( ) : void 初回アクセスメッセージ用のフラグを更新する

Method Details

__construct() public method

コンストラクタ
public __construct ( CakeRequest $request = null, CakeResponse $response = null )
$request CakeRequest リクエストオブジェクト
$response CakeResponse レスポンスオブジェクト

_adminSslMethods() protected method

管理画面用のメソッドを取得(コールバックメソッド)
protected _adminSslMethods ( string $var ) : boolean
$var string
return boolean

_autoConvertEncodingByArray() protected method

配列の文字コードを変換する
protected _autoConvertEncodingByArray ( array $data, string $outenc ) : array
$data array 変換前データ
$outenc string 変換後の文字コード
return array 変換後データ

_blackHoleCallback() public method

フォーム改ざん対策・CSRF対策・SSL制限・HTTPメソッド制限などへの違反が原因で Securityコンポーネントに"ブラックホールされた"場合の動作を指定する
public _blackHoleCallback ( string $err ) : void
$err string エラーの種類
return void

_checkReferer() protected method

リファラチェックを行う
protected _checkReferer ( ) : boolean
return boolean

_checkSubmitToken() protected method

- GETでのアクセスの場合 not found - トークンが送信されていない場合 not found
protected _checkSubmitToken ( )

_loadViewConditions() protected method

画面の情報をセッションから読み込む
protected _loadViewConditions ( array $filterModels = [], array | string $options = [] ) : void
$filterModels array
$options array | string オプション
return void

_saveViewConditions() protected method

画面の情報をセッションに保存する
protected _saveViewConditions ( array $filterModels = [], array $options = [] ) : void
$filterModels array
$options array オプション
return void

_sslFail() protected method

SSL通信が必要なURLの際にSSLでない場合、 SSLのURLにリダイレクトさせる
protected _sslFail ( string $err ) : void
$err string エラーの種類
return void

admin_ajax_batch() public method

一括処理としてコントローラーの次のメソッドを呼び出す バッチ処理名は、バッチ処理指定用のコンボボックスで定義する _batch{バッチ処理名} 処理結果として成功の場合は、バッチ処理名を出力する
public admin_ajax_batch ( ) : void
return void

admin_ajax_get_token() public method

admin用Token取得アクション
public admin_ajax_get_token ( ) : string
return string

admin_ajax_save_favorite_box() public method

よく使う項目の表示状態を保存する
public admin_ajax_save_favorite_box ( mixed $open = '' ) : void
$open mixed 1 Or ''
return void

ajaxError() protected method

Ajax用のエラーを出力する
protected ajaxError ( integer $errorNo = 500, mixed $message = '' ) : void
$errorNo integer エラーのステータスコード
$message mixed エラーメッセージ
return void

beforeFilter() public method

beforeFilter
public beforeFilter ( ) : void
return void

beforeRender() public method

beforeRender
public beforeRender ( ) : void
return void

convertBetweenCondition() protected method

BETWEEN 条件を生成
protected convertBetweenCondition ( string $fieldName, mixed $value ) : array
$fieldName string フィールド名
$value mixed
return array

convertSelectTextCondition() protected method

Select Text 用の条件を生成する
protected convertSelectTextCondition ( string $fieldName, mixed $values, array $options = [] ) : string
$fieldName string フィールド名
$values mixed
$options array オプション
return string

dispatchEvent() public method

イベントを発火
public dispatchEvent ( string $name, array $params = [], array $options = [] ) : mixed
$name string イベント名
$params array パラメータ
$options array オプション
return mixed

generatePassword() protected method

ランダムなパスワード文字列を生成する
protected generatePassword ( integer $len = 8 ) : string
$len integer 文字列の長さ
return string パスワード

getBaserVersion() protected method

baserCMSのバージョンを取得する
protected getBaserVersion ( string $plugin = '' ) : string
$plugin string プラグイン名
return string Baserバージョン

getCakeVersion() protected method

CakePHPのバージョンを取得する
protected getCakeVersion ( ) : string
return string Baserバージョン

getSiteVersion() protected method

DBのバージョンを取得する
protected getSiteVersion ( string $plugin = '' ) : string
$plugin string プラグイン名
return string

getThemeVersion() protected method

テーマのバージョン番号を取得する
protected getThemeVersion ( string $theme ) : string
$theme string テーマ名
return string

getToken() protected method

Token の key を取得 CSRF対策のためにフォームのトークンを入手するためのもの adminと表画面でアクションを分離するために、取得部分を共通化
protected getToken ( ) : string
return string

getUserModel() protected method

リクエストされた画面に対しての認証用ユーザーモデルを取得する
protected getUserModel ( ) : mixed
return mixed string Or false

isAuthorized() public method

認証完了後処理
public isAuthorized ( array $user ) : boolean
$user array 認証されたユーザー情報
return boolean

notFound() protected method

NOT FOUNDページを出力する
protected notFound ( ) : void
return void

redirect() public method

Script execution is halted after the redirect.
public redirect ( mixed $url, integer $status = null, boolean $exit = true ) : mixed
$url mixed A string or array-based URL pointing to another location within the app, or an absolute URL
$status integer Optional HTTP status code (eg: 404)
$exit boolean If true, exit() will be called after the redirect
return mixed void if $exit = false. Terminates script if $exit = true

referer() public method

Returns the referring URL for this request.
public referer ( string $default = null, boolean $local = false ) : string
$default string Default URL to use if HTTP_REFERER cannot be read from headers
$local boolean If true, restrict referring URLs to local server
return string Referring URL

requestAction() public method

Calls a controller's method from any location.
public requestAction ( mixed $url, array $extra = [] ) : mixed
$url mixed String or array-based url.
$extra array if array includes the key "return" it sets the AutoRender to true.
return mixed Boolean true or false on success/failure, or contents of rendered action if 'return' is set in $extra.

sendMail() protected method

メールを送信する
protected sendMail ( string $to, string $title = '', mixed $body = '', array $options = [] ) : boolean
$to string 送信先アドレス
$title string タイトル
$body mixed 本文
$options array オプション
return boolean 送信結果

setAction() public method

setAction('another_action'); setAction('action_with_parameters', $parameter1);
public setAction ( string $action ) : mixed
$action string The new action to be redirected to
return mixed Returns the return value of the called action

setMessage() protected method

メッセージをビューにセットする
protected setMessage ( string $message, boolean $alert = false, boolean $saveDblog = false, boolean $setFlash = true ) : void
$message string メッセージ
$alert boolean 警告かどうか
$saveDblog boolean Dblogに保存するか
$setFlash boolean flash message に保存するか
return void

setTheme() protected method

テーマをセットする
protected setTheme ( ) : void
return void

setThemeHelpers() protected method

テーマ用のヘルパーをセットする 管理画面では読み込まない
protected setThemeHelpers ( ) : void
return void

setViewConditions() protected method

画面の情報をセットする
protected setViewConditions ( array $filterModels = [], array $options = [] ) : void
$filterModels array
$options array オプション
return void

Property Details

$adminTheme public_oe property

管理画面テーマ
public string $adminTheme
return string

$components public_oe property

コンポーネント
public array $components
return array

$content public_oe property

コンテンツデータ
public array $content
return array

$contentsTitle public_oe property

コンテンツタイトル
public string $contentsTitle
return string

$crumbs public_oe property

パンくずナビ
public array $crumbs
return array

$help public_oe property

ヘルプ
public string $help
return string

$helpers public_oe property

TODO 見直し
public $helpers

$layout public_oe property

レイアウト
public string $layout
return string

$pageTitle public_oe property

ページタイトル
public string $pageTitle
return string

$preview public_oe property

プレビューフラグ
public bool $preview
return boolean

$site public_oe property

サイトデータ
public array $site
return array

$siteConfigs public_oe property

サイトコンフィグデータ
public array $siteConfigs
return array

$siteDescription public_oe property

ページ説明文
public string $siteDescription
return string

$subDir public_oe property

サブディレクトリ
public string $subDir
return string

$subMenuElements public_oe property

サブメニューエレメント
public string $subMenuElements
return string

$uses public_oe property

モデル
public mixed $uses
return mixed

$viewClass public_oe property

view
public string $viewClass
return string