PHP Class BcAppController

Inheritance: extends Controller
Afficher le fichier Open project: baserproject/basercms

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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:

Méthodes protégées

Méthode 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

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

Method Details

__construct() public méthode

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

_adminSslMethods() protected méthode

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

_autoConvertEncodingByArray() protected méthode

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

_blackHoleCallback() public méthode

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

_checkReferer() protected méthode

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

_checkSubmitToken() protected méthode

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

_loadViewConditions() protected méthode

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

_saveViewConditions() protected méthode

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

_sslFail() protected méthode

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

admin_ajax_batch() public méthode

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

admin_ajax_get_token() public méthode

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

admin_ajax_save_favorite_box() public méthode

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

ajaxError() protected méthode

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

beforeFilter() public méthode

beforeFilter
public beforeFilter ( ) : void
Résultat void

beforeRender() public méthode

beforeRender
public beforeRender ( ) : void
Résultat void

convertBetweenCondition() protected méthode

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

convertSelectTextCondition() protected méthode

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

dispatchEvent() public méthode

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

generatePassword() protected méthode

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

getBaserVersion() protected méthode

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

getCakeVersion() protected méthode

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

getSiteVersion() protected méthode

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

getThemeVersion() protected méthode

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

getToken() protected méthode

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

getUserModel() protected méthode

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

isAuthorized() public méthode

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

notFound() protected méthode

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

redirect() public méthode

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
Résultat mixed void if $exit = false. Terminates script if $exit = true

referer() public méthode

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
Résultat string Referring URL

requestAction() public méthode

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.
Résultat mixed Boolean true or false on success/failure, or contents of rendered action if 'return' is set in $extra.

sendMail() protected méthode

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

setAction() public méthode

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

setMessage() protected méthode

メッセージをビューにセットする
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 に保存するか
Résultat void

setTheme() protected méthode

テーマをセットする
protected setTheme ( ) : void
Résultat void

setThemeHelpers() protected méthode

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

setViewConditions() protected méthode

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

Property Details

$adminTheme public_oe property

管理画面テーマ
public string $adminTheme
Résultat string

$components public_oe property

コンポーネント
public array $components
Résultat array

$content public_oe property

コンテンツデータ
public array $content
Résultat array

$contentsTitle public_oe property

コンテンツタイトル
public string $contentsTitle
Résultat string

$crumbs public_oe property

パンくずナビ
public array $crumbs
Résultat array

$help public_oe property

ヘルプ
public string $help
Résultat string

$helpers public_oe property

TODO 見直し
public $helpers

$layout public_oe property

レイアウト
public string $layout
Résultat string

$pageTitle public_oe property

ページタイトル
public string $pageTitle
Résultat string

$preview public_oe property

プレビューフラグ
public bool $preview
Résultat boolean

$site public_oe property

サイトデータ
public array $site
Résultat array

$siteConfigs public_oe property

サイトコンフィグデータ
public array $siteConfigs
Résultat array

$siteDescription public_oe property

ページ説明文
public string $siteDescription
Résultat string

$subDir public_oe property

サブディレクトリ
public string $subDir
Résultat string

$subMenuElements public_oe property

サブメニューエレメント
public string $subMenuElements
Résultat string

$uses public_oe property

モデル
public mixed $uses
Résultat mixed

$viewClass public_oe property

view
public string $viewClass
Résultat string