Source for file Ethna_View_List.php
Documentation is available at Ethna_View_List.php
// vim: foldmethod=marker
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
* @author Masaki Fujimoto <fujimoto@php.net>
/** @var int 表示開始オフセット */
/** @var array 検索対象項目一覧 */
var $search_list =
array();
/** @var string 検索マネージャクラス名 */
var $manager_name =
null;
/** @var string 表示対象クラス名 */
$this->offset =
$this->af->get('offset');
if ($this->offset ==
"") {
if (intval($this->af->get('count')) >
0) {
$this->count =
intval($this->af->get('count'));
foreach ($this->search_list as $key) {
if ($this->af->get("s_$key") !=
"") {
$filter[$key] =
$this->af->get("s_$key");
if ($this->af->get("sort") ==
$key) {
$manager_name =
$this->manager_name;
for ($i =
0; $i <
2; $i++
) {
list
($total, $obj_list) =
$this->$manager_name->getObjectList($this->class_name, $filter, $sort, $this->offset, $this->count);
if (count($obj_list) ==
0 &&
$this->offset >=
$total) {
foreach ($obj_list as $obj) {
$value =
$obj->getNameObject();
$this->af->setApp($list_name, $r);
$this->af->setApp('nav', $this->_getNavigation($total, $obj_list));
$this->af->setAppNE('query', $this->_getQueryParameter());
* @param int $total 検索総件数
* @param array $list 検索結果
* @return array ナビゲーション情報を格納した配列
function _getNavigation($total, &$list)
$nav['offset'] =
$this->offset;
$nav['from'] =
$this->offset +
1;
$nav['to'] =
$this->offset +
count($list);
$prev_offset =
$this->offset -
$this->count;
$nav['prev_offset'] =
$prev_offset;
if ($this->offset +
$this->count <
$total) {
$next_offset =
$this->offset +
count($list);
$nav['next_offset'] =
$next_offset;
* @param array $search_list 検索対象一覧
* @return string 検索内容を格納したGET引数
function _getQueryParameter()
foreach ($this->search_list as $key) {
$value =
$this->af->get("s_$key");
Documentation generated on Fri, 11 Nov 2011 04:01:13 +0900 by phpDocumentor 1.4.3