git-svn-id: http://xe-core.googlecode.com/svn/trunk@393 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-13 07:27:53 +00:00
parent 4e044cbbfd
commit 3890c0c97c
40 changed files with 682 additions and 82 deletions

View file

@ -232,6 +232,7 @@
}
$schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema,",\n"), "ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci");
$output = $this->_query($schema);
if(!$output) return false;
}
@ -369,6 +370,8 @@
* 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
**/
function _getNavigationData($table, $columns, $condition, $navigation) {
require_once('./classes/page/PageHandler.class.php');
// 전체 개수를 구함
$count_query = sprintf("select count(*) as count from %s %s", $table, $condition);
$result = $this->_query($count_query);
@ -390,7 +393,16 @@
$index = implode(',',$index_list);
$query = sprintf('select %s from %s %s order by %s limit %d, %d', $columns, $table, $condition, $index, $start_count, $navigation->list_count);
$result = $this->_query($query);
if($this->errno!=0) return;
if($this->errno!=0) {
$buff = new Object();
$buff->total_count = 0;
$buff->total_page = 0;
$buff->page = 1;
$buff->data = array();
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $navigation->page_count);
return $buff;
}
$virtual_no = $total_count - ($page-1)*$navigation->list_count;
while($tmp = mysql_fetch_object($result)) {
@ -403,7 +415,6 @@
$buff->page = $page;
$buff->data = $data;
require_once('./classes/page/PageHandler.class.php');
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $navigation->page_count);
return $buff;
}

View file

@ -252,6 +252,10 @@
$instance_name = sprintf("%s%s",$module,"Model");
$class_file = sprintf('%s%s.%s.php', $class_path, $module, $type);
break;
case 'class' :
$instance_name = $module;
$class_file = sprintf('%s%s.class.php', $class_path, $module);
break;
default :
$type = 'view';
$instance_name = sprintf("%s%s",$module,"View");
@ -274,7 +278,10 @@
// 생성된 객체에 자신이 호출된 위치를 세팅해줌
$oModule->setModule($module);
$oModule->setModulePath($class_path);
$oModule->init();
if(method_exists($oModule, 'init') && !$GLOBALS['_inited_module'][$module][$type]) {
$GLOBALS['_inited_module'][$module][$type] = true;
$oModule->init();
}
// GLOBALS 변수에 생성된 객체 저장
$GLOBALS['_loaded_module'][$module][$type] = $oModule;

View file

@ -135,9 +135,6 @@
// 권한변수 설정
$this->grant = $grant;
Context::set('grant', $grant);
// 모듈의 init method 실행
$this->init();
}
/**