* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
*/
App::uses('AppHelper', 'View/Helper');
App::uses('Page', 'Pages.Model');
App::uses('Folder', 'Utility');
/**
* LayoutHelper
*
*/
class PagesEditHelper extends AppHelper {
/**
* 使用するヘルパー
*
* @var array
*/
public $helpers = array(
'NetCommons.NetCommonsHtml',
);
/**
* ページ順序配列
*
* @var array
*/
protected $_pageWeight = array();
/**
* Before render callback. beforeRender is called before the view file is rendered.
*
* Overridden in subclasses.
*
* @param string $viewFile The view file that is going to be rendered
* @return void
*/
public function beforeRender($viewFile) {
$this->NetCommonsHtml->css('/pages/css/style.css');
parent::beforeRender($viewFile);
}
/**
* レイアウト変更のimgデータ取得
*
* @return array imgリスト
*/
public function getLayouts() {
$dir = new Folder(
CakePlugin::path('Pages') . WEBROOT_DIR . DS . 'img' . DS . 'layouts'
);
$files = $dir->find('.*\.png', true);
return $files;
}
/**
* インデント
*
* @param int $pageId ページID
* @return string HTML
*/
public function indent($pageId) {
$parentId = $this->_View->viewVars['pages'][$pageId]['Page']['parent_id'];
$nest = $this->_View->viewVars['parentList']['_' . $parentId]['_' . $pageId]['nest'];
return str_repeat(' ', $nest);
}
/**
* タイトルタグのヘルプの表示
*
* @return string ヘルプHTML出力
*/
public function helpMetaTitle() {
$html = '';
$html .= __d('pages',
'The keywords in the title influences the search order of the search engine. ' .
'The keyword in the head is important.') . '
';
$content = __d('net_commons', '{X-SITE_NAME} : Site name') . '
';
$content .= __d('pages', '{X-PAGE_NAME} : Page name');
$content = __d('net_commons', 'Each of the embedded keywords, will be converted ' .
'to the corresponding content.
') . $content;
$html .= __d('pages', 'The item can use an embedded keyword.') . ' ';
$html .= '';
$html .= '';
$html .= '';
$html .= '';
return $html;
}
}