renamed some configuration items

- max_logs_per_page
 - max_logs_in_project_home
 - max_log_in_site_home
added the full change log view for a project
merged the user controller to the site controller
removed the user controller
This commit is contained in:
hyung-hwan 2010-03-04 12:40:27 +00:00
parent 50d8cecdae
commit c9e6b622c4
40 changed files with 461 additions and 354 deletions

View File

@ -92,19 +92,19 @@ max_upload_size = "10000"
max_latest_projects = "10"
;------------------------------------------------------------------------------
; Maximum number of site log entries to show per page
; Maximum number of log entries to show per details page
;------------------------------------------------------------------------------
max_site_logs_per_page = "50"
max_logs_per_page = "50"
;------------------------------------------------------------------------------
; Maximum number of svn commits to show in the front page
; Maximum number of log entries to show in the front page
;------------------------------------------------------------------------------
max_svn_commits = "10"
max_logs_in_site_home = "10"
;------------------------------------------------------------------------------
; Maximum number of svn commits to show in the project home page
; Maximum number of log entries to show in the project home page
;------------------------------------------------------------------------------
max_svn_commits_in_project = "5"
max_logs_in_project_home = "5"
;------------------------------------------------------------------------------
; directory to accomodate subversion repositories

View File

@ -40,7 +40,7 @@
|
*/
$route['default_controller'] = "user";
$route['default_controller'] = "site";
$route['scaffolding_trigger'] = "";

View File

@ -7,7 +7,6 @@ www_DATA = \
project.php \
site.php \
source.php \
user.php \
wiki.php
EXTRA_DIST = $(www_DATA)

View File

@ -170,7 +170,6 @@ www_DATA = \
project.php \
site.php \
source.php \
user.php \
wiki.php
EXTRA_DIST = $(www_DATA)

View File

@ -44,7 +44,7 @@ class Main extends Controller
else
{
if ($user_url != "") redirect ($user_url);
else redirect ('user/home');
else redirect ('site/home');
}
}
else
@ -74,7 +74,7 @@ class Main extends Controller
{
$this->login->deauthenticate ();
if ($url != "") redirect ($this->converter->HexToAscii($url));
else redirect ('user/home');
else redirect ('site/home');
}
}

View File

@ -6,6 +6,7 @@ class Project extends Controller
var $VIEW_HOME = 'project_home';
var $VIEW_EDIT = 'project_edit';
var $VIEW_DELETE = 'project_delete';
var $VIEW_LOG = 'log';
function Project ()
{
@ -47,7 +48,7 @@ class Project extends Controller
else
{
$log_entries = $this->logs->getEntries (
0, CODEPOT_MAX_SVN_COMMITS_IN_PROJECT, $projectid);
0, CODEPOT_MAX_LOGS_IN_PROJECT_HOME, $projectid);
if ($log_entries === FALSE)
{
$data['message'] = 'DATABASE ERROR';
@ -158,7 +159,7 @@ class Project extends Controller
$this->_edit_project ($project, 'create', $login);
}
function update ($projectid)
function update ($projectid = '')
{
$this->load->model ('ProjectModel', 'projects');
@ -223,8 +224,8 @@ class Project extends Controller
else
{
// the project has been deleted successfully.
// go back to the user home.
redirect ('user/projectlist');
// go back to the project list.
redirect ('site/projectlist');
}
}
else
@ -252,7 +253,7 @@ class Project extends Controller
}
}
function delete ($projectid)
function delete ($projectid = '')
{
$this->load->model ('ProjectModel', 'projects');
@ -286,6 +287,66 @@ class Project extends Controller
$this->_delete_project ($project, $login);
}
}
function log ($projectid = '', $offset = 0)
{
$this->load->model ('ProjectModel', 'projects');
$login = $this->login->getUser ();
$project = $this->projects->get ($projectid);
if ($project === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($project === NULL)
{
$data['login'] = $login;
$data['message'] =
$this->lang->line('MSG_NO_SUCH_PROJECT') .
" - {$projectid}";
$this->load->view ($this->VIEW_ERROR, $data);
}
else
{
$this->load->library ('pagination');
$this->load->model ('LogModel', 'logs');
$num_log_entries = $this->logs->getNumEntries ($projectid);
if ($num_log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$pagecfg['base_url'] = site_url() . "/project/log/{$projectid}/";
$pagecfg['total_rows'] = $num_log_entries;
$pagecfg['per_page'] = CODEPOT_MAX_LOGS_PER_PAGE;
$pagecfg['uri_segment'] = 4;
$log_entries = $this->logs->getEntries ($offset, $pagecfg['per_page'], $projectid);
if ($log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$this->pagination->initialize ($pagecfg);
$data['project'] = $project;
$data['login'] = $login;
$data['log_entries'] = $log_entries;
$data['page_links'] = $this->pagination->create_links ();
$this->load->view ($this->VIEW_LOG, $data);
}
}
}
?>

View File

@ -3,8 +3,11 @@
class Site extends Controller
{
var $VIEW_ERROR = 'error';
var $VIEW_HOME = 'site_home';
var $VIEW_EDIT = 'site_edit';
var $VIEW_DELETE = 'site_delete';
var $VIEW_LOG = 'log';
var $VIEW_PROJECT_LIST = 'project_list';
function Site ()
{
@ -19,6 +22,58 @@ class Site extends Controller
$this->lang->load ('common', CODEPOT_LANG);
}
function index ()
{
return $this->home ();
}
function home ()
{
$login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin');
$this->load->model ('SiteModel', 'sites');
$this->load->model ('ProjectModel', 'projects');
$this->load->model ('LogModel', 'logs');
$site = $this->sites->get (CODEPOT_DEFAULT_SITEID);
if ($site === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
if ($site === NULL) $site = $this->sites->getDefault ();
$latest_projects = $this->projects->getLatestProjects ($login['id'], CODEPOT_MAX_LATEST_PROJECTS);
if ($latest_projects === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$log_entries = $this->logs->getEntries (0, CODEPOT_MAX_LOGS_IN_SITE_HOME);
if ($log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$data['login'] = $login;
$data['latest_projects'] = $latest_projects;
$data['log_entries'] = $log_entries;
$data['site'] = $site;
//$data['user_name'] = '';
//$data['user_pass'] = '';
$this->load->view ($this->VIEW_HOME, $data);
}
function _edit_site ($site, $mode, $login)
{
$this->load->helper ('form');
@ -65,8 +120,8 @@ class Site extends Controller
}
else
{
//redirect ('user/home/' . $site->id);
redirect ('user/home');
//redirect ('site/home/' . $site->id);
redirect ('site/home');
}
}
else
@ -177,16 +232,16 @@ class Site extends Controller
else
{
// the site has been deleted successfully.
// go back to the user home.
redirect ('user/home');
// go back to the site home.
redirect ('site/home');
}
}
else
{
// the confirm checkbox is not checked.
// go back to the site home page.
//redirect ('user/home/' . $site->id);
redirect ('user/home');
//redirect ('site/home/' . $site->id);
redirect ('site/home');
}
}
else
@ -238,6 +293,108 @@ class Site extends Controller
$this->_delete_site ($site, $login);
}
}
function log ($offset = 0)
{
$login = $this->login->getUser ();
$this->load->library ('pagination');
$this->load->model ('LogModel', 'logs');
$num_log_entries = $this->logs->getNumEntries ();
if ($num_log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$pagecfg['base_url'] = site_url() . '/site/log/';
$pagecfg['total_rows'] = $num_log_entries;
$pagecfg['per_page'] = CODEPOT_MAX_LOGS_PER_PAGE;
$pagecfg['uri_segment'] = 3;
$log_entries = $this->logs->getEntries ($offset, $pagecfg['per_page']);
if ($log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$this->pagination->initialize ($pagecfg);
$data['login'] = $login;
$data['log_entries'] = $log_entries;
$data['page_links'] = $this->pagination->create_links ();
$this->load->view ($this->VIEW_LOG, $data);
}
function projectlist ()
{
$login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin');
$this->load->model ('ProjectModel', 'projects');
$projects = $this->projects->getMyProjects ($login['id']);
$other_projects = $this->projects->getOtherProjects ($login['id']);
if ($projects === FALSE || $other_projects === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
}
else
{
$data['login'] = $login;
$data['projects'] = $projects;
$data['other_projects'] = $other_projects;
$this->load->view ($this->VIEW_PROJECT_LIST, $data);
}
}
function preference ()
{
$login = $this->login->getUser();
if ($login['id'] == '') redirect ('main/signin');
$this->load->view (
$this->VIEW_ERROR,
array (
'login' => $login,
'message' => 'USER PREFERENCE NOT SUPPORTED YET'
)
);
}
function admin ()
{
$login = $this->login->getUser();
if ($login['id'] == '') redirect ('main/signin');
if ($login['sysadmin?'])
{
echo "...Site Administration...";
}
else
{
$this->load->view (
$this->VIEW_ERROR,
array (
'login' => $login,
'message' => 'NO PERMISSION'
)
);
}
}
}
?>

View File

@ -1,178 +0,0 @@
<?php
class User extends Controller
{
var $VIEW_ERROR = 'error';
var $VIEW_HOME = 'user_home';
var $VIEW_PROJECT_LIST = 'project_list';
var $VIEW_SITELOG = 'user_sitelog';
function User ()
{
parent::Controller ();
$this->load->helper ('url');
$this->load->helper ('form');
$this->load->library ('Converter', 'converter');
$this->load->model (CODEPOT_LOGIN_MODEL, 'login');
$this->load->library ('Language', 'lang');
$this->lang->load ('common', CODEPOT_LANG);
}
function index ()
{
return $this->home ();
}
function home ()
{
$login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin');
$this->load->model ('SiteModel', 'sites');
$this->load->model ('ProjectModel', 'projects');
$this->load->model ('LogModel', 'logs');
$site = $this->sites->get (CODEPOT_DEFAULT_SITEID);
if ($site === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
if ($site === NULL) $site = $this->sites->getDefault ();
$latest_projects = $this->projects->getLatestProjects ($login['id'], CODEPOT_MAX_LATEST_PROJECTS);
if ($latest_projects === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$log_entries = $this->logs->getEntries (0, CODEPOT_MAX_SVN_COMMITS);
if ($log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$data['login'] = $login;
$data['latest_projects'] = $latest_projects;
$data['log_entries'] = $log_entries;
$data['site'] = $site;
//$data['user_name'] = '';
//$data['user_pass'] = '';
$this->load->view ($this->VIEW_HOME, $data);
}
function sitelog ($offset = 0)
{
$login = $this->login->getUser ();
$this->load->library ('pagination');
$this->load->model ('LogModel', 'logs');
$num_log_entries = $this->logs->getNumEntries ();
if ($num_log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$pagecfg['base_url'] = site_url() . '/user/sitelog/';
$pagecfg['total_rows'] = $num_log_entries;
$pagecfg['per_page'] = CODEPOT_MAX_SITE_LOGS_PER_PAGE;
$log_entries = $this->logs->getEntries ($offset, $pagecfg['per_page']);
if ($log_entries === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$this->pagination->initialize ($pagecfg);
$data['login'] = $login;
$data['log_entries'] = $log_entries;
$data['page_links'] = $this->pagination->create_links ();
$this->load->view ($this->VIEW_SITELOG, $data);
}
function projectlist ()
{
$login = $this->login->getUser ();
if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '')
redirect ('main/signin');
$this->load->model ('ProjectModel', 'projects');
$projects = $this->projects->getMyProjects ($login['id']);
$other_projects = $this->projects->getOtherProjects ($login['id']);
if ($projects === FALSE || $other_projects === FALSE)
{
$data['login'] = $login;
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
}
else
{
$data['login'] = $login;
$data['projects'] = $projects;
$data['other_projects'] = $other_projects;
$this->load->view ($this->VIEW_PROJECT_LIST, $data);
}
}
function preference ()
{
$login = $this->login->getUser();
if ($login['id'] == '') redirect ('main/signin');
$this->load->view (
$this->VIEW_ERROR,
array (
'login' => $login,
'message' => 'USER PREFERENCE NOT SUPPORTED YET'
)
);
}
function admin ()
{
$login = $this->login->getUser();
if ($login['id'] == '') redirect ('main/signin');
if ($login['sysadmin?'])
{
echo "...Site Administration...";
}
else
{
$this->load->view (
$this->VIEW_ERROR,
array (
'login' => $login,
'message' => 'NO PERMISSION'
)
);
}
}
}
?>

View File

@ -22,7 +22,7 @@ class Wiki extends Controller
}
function home ($projectid = "")
function home ($projectid = '')
{
$this->load->model ('ProjectModel', 'projects');
$this->load->model ('WikiModel', 'wikis');
@ -62,7 +62,7 @@ class Wiki extends Controller
}
}
function show ($projectid, $name)
function _show_wiki ($projectid, $name, $create)
{
$this->load->model ('ProjectModel', 'projects');
$this->load->model ('WikiModel', 'wikis');
@ -72,6 +72,13 @@ class Wiki extends Controller
redirect ('main/signin');
$data['login'] = $login;
if ($name == '')
{
$data['message'] = 'INVALID PARAMETERS';
$this->load->view ($this->VIEW_ERROR, $data);
return;
}
$name = $this->converter->HexToAscii ($name);
$project = $this->projects->get ($projectid);
@ -119,11 +126,21 @@ class Wiki extends Controller
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($wiki === NULL)
{
if ($create)
{
redirect ("wiki/create/{$projectid}/" .
$this->converter->AsciiToHex($name));
}
else
{
$data['message'] =
$this->lang->line('MSG_NO_SUCH_WIKI_PAGE') .
" - {$name}";
$this->load->view ($this->VIEW_ERROR, $data);
}
}
else
{
$data['project'] = $project;
$data['wiki'] = $wiki;
@ -133,6 +150,16 @@ class Wiki extends Controller
}
}
function show ($projectid = '' , $name = '')
{
$this->_show_wiki ($projectid, $name, TRUE);
}
function show_r ($projectid = '' , $name = '')
{
$this->_show_wiki ($projectid, $name, FALSE);
}
function _edit_wiki ($projectid, $name, $mode)
{
$this->load->helper ('form');
@ -228,7 +255,9 @@ class Wiki extends Controller
}
else if ($wiki == NULL)
{
$data['message'] = "NO SUCH WIKI PAGE - $name";
$data['message'] =
$this->lang->line('MSG_NO_SUCH_WIKI_PAGE') .
" - {$name}";
$this->load->view ($this->VIEW_ERROR, $data);
}
else
@ -251,17 +280,17 @@ class Wiki extends Controller
}
}
function create ($projectid, $name = "")
function create ($projectid = '', $name = '')
{
return $this->_edit_wiki ($projectid, $name, "create");
return $this->_edit_wiki ($projectid, $name, 'create');
}
function update ($projectid, $name)
function update ($projectid = '', $name = '')
{
return $this->_edit_wiki ($projectid, $name, "update");
return $this->_edit_wiki ($projectid, $name, 'update');
}
function delete ($projectid, $name)
function delete ($projectid = '', $name = '')
{
$this->load->helper ('form');
$this->load->library ('form_validation');
@ -326,12 +355,12 @@ class Wiki extends Controller
}
else
{
redirect ('wiki/home/' . $project->id);
redirect ("wiki/home/{$project->id}");
}
}
else
{
redirect ('wiki/show/' . $project->id . '/' .
redirect ("wiki/show/{$project->id}/" .
$this->converter->AsciiToHex($wiki->name));
}
}
@ -352,7 +381,9 @@ class Wiki extends Controller
}
else if ($wiki === NULL)
{
$data['message'] = "NO SUCH WIKI PAGE - $name";
$data['message'] =
$this->lang->line('MSG_NO_SUCH_WIKI_PAGE') .
" - {$name}";
$this->load->view ($this->VIEW_ERROR, $data);
}
else

View File

@ -15,6 +15,7 @@ $lang['Difference'] = 'Diff';
$lang['Directory'] = 'Directory';
$lang['Download'] = 'Download';
$lang['Edit'] = 'Edit';
$lang['Error'] = 'Error';
$lang['Head revision'] = 'Head revision';
$lang['History'] = 'History';
$lang['Home'] = 'Home';
@ -64,6 +65,7 @@ $lang['MSG_NO_DIFF'] = 'No difference found';
$lang['MSG_NO_FILES_AVAIL'] = 'No files available';
$lang['MSG_NO_SOURCE_CODE_AVAIL'] = 'No source code available';
$lang['MSG_NO_SUCH_PROJECT'] = 'No such project';
$lang['MSG_NO_SUCH_WIKI_PAGE'] = 'No such wiki page';
$lang['MSG_NO_WIKIS_AVAIL'] = 'No wiki pages available';
$lang['MSG_SURE_TO_DELETE_THIS'] = "I'm sure to delete this";
?>

View File

@ -15,6 +15,7 @@ $lang['Difference'] = 'Beda';
$lang['Directory'] = 'Direktori';
$lang['Download'] = 'Download';
$lang['Edit'] = 'Rubah';
$lang['Error'] = 'Error';
$lang['Head revision'] = 'Kepala revisi';
$lang['History'] = 'Sejarah';
$lang['Home'] = 'Beranda';
@ -54,15 +55,16 @@ $lang['Username'] = 'Nama pemakai';
$lang['Wiki'] = 'Wiki';
$lang['Wikis'] = 'Wiki';
$lang['MSG_LOG_COMMIT_BY'] = 'committed by %s';
$lang['MSG_LOG_CREATE_BY'] = 'created by %s';
$lang['MSG_LOG_DELETE_BY'] = 'deleted by %s';
$lang['MSG_LOG_UPDATE_BY'] = 'updated by %s';
$lang['MSG_LOG_COMMIT_BY'] = 'Dicommit oleh %s';
$lang['MSG_LOG_CREATE_BY'] = 'Dibuat oleh %s';
$lang['MSG_LOG_DELETE_BY'] = 'Dihapus oleh %s';
$lang['MSG_LOG_UPDATE_BY'] = 'Diupdate oleh %s';
$lang['MSG_NO_DIFF'] = 'Tidak ada bedanya';
$lang['MSG_NO_FILES_AVAIL'] = 'Tidak ada file tersedia';
$lang['MSG_NO_SOURCE_CODE_AVAIL'] = 'Tidak ada kode sumber tersedia';
$lang['MSG_NO_SUCH_PROJECT'] = 'No such project';
$lang['MSG_NO_SUCH_WIKI_PAGE'] = 'No such wiki page';
$lang['MSG_NO_WIKIS_AVAIL'] = 'Tidak ada halaman wiki tersedia';
$lang['MSG_SURE_TO_DELETE_THIS'] = "Saya yakin untuk menghapus";
?>

View File

@ -15,6 +15,7 @@ $lang['Difference'] = '차이점';
$lang['Directory'] = '디렉토리';
$lang['Download'] = '내려받기';
$lang['Edit'] = '수정';
$lang['Error'] = '오류';
$lang['Head revision'] = '최신리비전';
$lang['History'] = '변경기록';
$lang['Home'] = '홈';
@ -63,6 +64,7 @@ $lang['MSG_NO_DIFF'] = '차이점이 없습니다';
$lang['MSG_NO_FILES_AVAIL'] = '사용가능한 파일이 없습니다';
$lang['MSG_NO_SOURCE_CODE_AVAIL'] = '사용가능한 소스코드가 없습니다';
$lang['MSG_NO_SUCH_PROJECT'] = '프로젝트가 없습니다';
$lang['MSG_NO_SUCH_WIKI_PAGE'] = '위키페이지가 없습니다';
$lang['MSG_NO_WIKIS_AVAIL'] = '사용가능한 위키페이지가 없습니다';
$lang['MSG_SURE_TO_DELETE_THIS'] = '반드시 이것을 삭제하고 싶어요';
?>

View File

@ -14,8 +14,15 @@ class LogModel extends Model
//$this->db->where ('type', 'code');
//$this->db->where ('action', 'commit');
if ($projectid != '') $this->db->where ('projectid', $projectid);
$num = $this->db->count_all ('log');
//$num = $this->db->count_all ('log');
$this->db->select ('count(id) as count');
$query = $this->db->get ('log');
$result = $query->result();
$num = empty($result)? 0: $result[0]->count;
$this->db->trans_complete ();
if ($this->db->trans_status() === FALSE) return FALSE;

View File

@ -7,6 +7,7 @@ www_DATA = \
file_show.php \
footer.php \
index.html \
log.php \
login.php \
project_delete.php \
project_edit.php \
@ -15,6 +16,7 @@ www_DATA = \
projectbar.php \
site_edit.php \
site_delete.php \
site_home.php \
source_blame.php \
source_diff.php \
source_file.php \
@ -22,8 +24,6 @@ www_DATA = \
source_history.php \
source_revision.php \
taskbar.php \
user_home.php \
user_sitelog.php \
wiki_delete.php \
wiki_edit.php \
wiki_home.php \

View File

@ -170,6 +170,7 @@ www_DATA = \
file_show.php \
footer.php \
index.html \
log.php \
login.php \
project_delete.php \
project_edit.php \
@ -178,6 +179,7 @@ www_DATA = \
projectbar.php \
site_edit.php \
site_delete.php \
site_home.php \
source_blame.php \
source_diff.php \
source_file.php \
@ -185,8 +187,6 @@ www_DATA = \
source_history.php \
source_revision.php \
taskbar.php \
user_home.php \
user_sitelog.php \
wiki_delete.php \
wiki_edit.php \
wiki_home.php \

View File

@ -1,6 +1,6 @@
<html>
<?php if (!isset($title)) $title = 'ERROR'; ?>
<?php if (!isset($title)) $title = $this->lang->line('Error'); ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@ -39,7 +39,9 @@ $this->load->view (
<?= $message ?>
</div>
</div> <!-- project_error_taskbar -->
<?php $this->load->view ('footer'); ?>
</div> <!-- project_error_content -->
</body>

View File

@ -15,7 +15,7 @@
<body>
<div class="content" id="user_sitelog_content">
<div class="content" id="log_content">
<!---------------------------------------------------------------------------->
@ -25,12 +25,15 @@
<?php
if (!isset($project)) $project = NULL;
if (!isset($site)) $site = NULL;
$this->load->view (
'projectbar',
array (
'project' => NULL,
'site' => NULL,
'pageid' => 'sitelog',
'site' => $site,
'project' => $project,
'pageid' => ((isset($project) && $project != NULL)? 'project': 'sitelog'),
'ctxmenuitems' => array ()
)
);
@ -38,15 +41,15 @@ $this->load->view (
<!---------------------------------------------------------------------------->
<div class="mainarea" id="user_sitelog_mainarea">
<div class="mainarea" id="log_mainarea">
<div class="title" id="user_sitelog_mainarea_title">
<div class="title" id="log_mainarea_title">
<?= $this->lang->line ('Change log') ?>
</div>
<div id="user_sitelog_mainarea_result">
<div id="log_mainarea_result">
<table id="user_sitelog_mainarea_result_table">
<table id="log_mainarea_result_table">
<?php
$curdate = '';
$xdot = $this->converter->AsciiToHex ('.');
@ -54,6 +57,9 @@ $this->load->view (
$rowclasses = array ('odd', 'even');
$rowcount = 0;
$numcols = 4;
if (isset($project) && $project != NULL) $numcols--;
foreach ($log_entries as $log)
{
if ($log['type'] == 'code')
@ -71,8 +77,8 @@ $this->load->view (
if ($curdate != $date)
{
print "<tr class='break'><td colspan=4 class='break'>&nbsp;</td></tr>";
print "<tr class='head'><td colspan=4 class='date'>$date</td></tr>";
print "<tr class='break'><td colspan='{$numcols}' class='break'>&nbsp;</td></tr>";
print "<tr class='head'><td colspan='{$numcols}' class='date'>$date</td></tr>";
$curdate = $date;
$rowcount = 0;
}
@ -81,9 +87,12 @@ $this->load->view (
$rowcount++;
print '<td class="time">' . $time . '</td>';
if (!isset($project) || $project == NULL)
{
print '<td class="projectid">';
print anchor ("/project/home/{$log['projectid']}", $log['projectid']);
print '</td>';
}
if ($log['type'] == 'code')
@ -114,11 +123,15 @@ $this->load->view (
{
$uri = "/project/home/{$log['projectid']}";
}
else if ($log['type'] == 'wiki' ||
$log['type'] == 'file')
else if ($log['type'] == 'wiki')
{
$hex = $this->converter->AsciiToHex ($log['message']);
$uri = "/{$log['type']}/show/{$log['projectid']}/{$hex}";
$uri = "/wiki/show_r/{$log['projectid']}/{$hex}";
}
else if ($log['type'] == 'file')
{
$hex = $this->converter->AsciiToHex ($log['message']);
$uri = "/file/show/{$log['projectid']}/{$hex}";
}
$trimmed = preg_replace("/(.{10}).+/u", "$1…", $log['message']);
@ -145,16 +158,16 @@ $this->load->view (
}
?>
<tr class='foot'>
<td colspan=4 class='pages'><?= $page_links ?></td>
<td colspan='<?=$numcols?>' class='pages'><?= $page_links ?></td>
</table>
</div> <!-- user_sitelog_mainarea_result -->
</div> <!-- log_mainarea_result -->
</div> <!-- user_sitelog_mainarea -->
</div> <!-- log_mainarea -->
<?php $this->load->view ('footer'); ?>
</div> <!-- user_sitelog_content -->
</div> <!-- log_content -->
</body>
</html>

View File

@ -16,8 +16,8 @@
</div>
<div class="boxa">
<?= anchor ('user/home', $this->lang->line('Home')) ?>
<?= anchor ('user/projectlist', $this->lang->line('Projects')) ?>
<?= anchor ('site/home', $this->lang->line('Home')) ?>
<?= anchor ('site/projectlist', $this->lang->line('Projects')) ?>
</div>
</div>

View File

@ -12,7 +12,7 @@ function render_wiki()
creole_render_wiki (
"project_home_textpre",
"project_home_textarea",
"<?=dirname(dirname(dirname(current_url())))?>/wiki/show/<?=$project->id?>/"
"<?=site_url()?>/wiki/show/<?=$project->id?>/"
);
}
</script>
@ -84,7 +84,7 @@ $this->load->view (
<div class="box">
<div class="boxtitle">
<?= $this->lang->line('Change log') ?>
<?= anchor ("/project/log/{$project->id}", $this->lang->line('Change log')) ?>
</div>
<table id="project_home_mainarea_sidebar_log_table">
<?php
@ -137,11 +137,15 @@ $this->load->view (
{
$uri = "/project/home/{$log['projectid']}";
}
else if ($log['type'] == 'wiki' ||
$log['type'] == 'file')
else if ($log['type'] == 'wiki')
{
$hex = $this->converter->AsciiToHex ($log['message']);
$uri = "/{$log['type']}/show/{$log['projectid']}/{$hex}";
$uri = "/wiki/show_r/{$log['projectid']}/{$hex}";
}
else if ($log['type'] == 'file')
{
$hex = $this->converter->AsciiToHex ($log['message']);
$uri = "/file/show/{$log['projectid']}/{$hex}";
}
$trimmed = preg_replace("/(.{20}).+/u", "$1…", $log['message']);

View File

@ -9,9 +9,9 @@
function render_wiki()
{
creole_render_wiki (
"user_home_mainarea_textpre",
"user_home_mainarea_text",
"<?=dirname(dirname(current_url()))?>/user/home/"
"site_home_mainarea_textpre",
"site_home_mainarea_text",
"<?=site_url()?>/site/home/"
);
}
</script>
@ -25,7 +25,7 @@ function render_wiki()
<body onLoad="render_wiki()">
<div class="content" id="user_home_content">
<div class="content" id="site_home_content">
<!---------------------------------------------------------------------------->
@ -58,9 +58,9 @@ $this->load->view (
<!---------------------------------------------------------------------------->
<div class="mainarea" id="user_home_mainarea">
<div class="mainarea" id="site_home_mainarea">
<div class="sidebar" id="user_home_mainarea_sidebar">
<div class="sidebar" id="site_home_mainarea_sidebar">
<div class="box">
<div class="boxtitle"><?=$this->lang->line('Latest projects')?></div>
@ -81,9 +81,9 @@ foreach ($latest_projects as $project)
<div class="box">
<div class="boxtitle">
<?= anchor ("/user/sitelog", $this->lang->line('Change log')) ?>
<?= anchor ("/site/log", $this->lang->line('Change log')) ?>
</div>
<table id="user_home_mainarea_sidebar_log_table">
<table id="site_home_mainarea_sidebar_log_table">
<?php
$xdot = $this->converter->AsciiToHex ('.');
foreach ($log_entries as $log)
@ -146,11 +146,15 @@ foreach ($latest_projects as $project)
{
$uri = "/project/home/{$log['projectid']}";
}
else if ($log['type'] == 'wiki' ||
$log['type'] == 'file')
else if ($log['type'] == 'wiki')
{
$hex = $this->converter->AsciiToHex ($log['message']);
$uri = "/{$log['type']}/show/{$log['projectid']}/{$hex}";
$uri = "/wiki/show_r/{$log['projectid']}/{$hex}";
}
else if ($log['type'] == 'file')
{
$hex = $this->converter->AsciiToHex ($log['message']);
$uri = "/file/show/{$log['projectid']}/{$hex}";
}
$trimmed = preg_replace("/(.{15}).+/u", "$1…", $log['message']);
@ -179,21 +183,21 @@ foreach ($latest_projects as $project)
</table>
</div>
</div> <!-- user_home_mainarea_sidebar -->
</div> <!-- site_home_mainarea_sidebar -->
<div id="user_home_mainarea_text">
<pre id="user_home_mainarea_textpre" style="visibility: hidden">
<div id="site_home_mainarea_text">
<pre id="site_home_mainarea_textpre" style="visibility: hidden">
<?php print htmlspecialchars($site->text); ?>
</pre>
</div> <!-- user_home_mainarea_text -->
</div> <!-- site_home_mainarea_text -->
<!----------------------------------------------------------->
</div> <!-- user_home_mainarea -->
</div> <!-- site_home_mainarea -->
<?php $this->load->view ('footer'); ?>
</div> <!-- user_home_content -->
</div> <!-- site_home_content -->
</body>
</html>

View File

@ -8,7 +8,7 @@ function show_taskbar ($con, $loginid, $issysadmin)
if (isset($loginid) && $loginid != '')
{
print anchor ('user/preference', htmlspecialchars($loginid));
print anchor ('site/preference', htmlspecialchars($loginid));
$hex = $con->converter->AsciiToHex (current_url());
print anchor ("main/signout/{$hex}", $con->lang->line('Sign out'));
@ -37,10 +37,10 @@ function show_taskbar ($con, $loginid, $issysadmin)
print '</div>';
print '<div class="boxa">';
print anchor ('user/home', $con->lang->line('Home'));
print anchor ('user/projectlist', $con->lang->line('Projects'));
print anchor ('site/home', $con->lang->line('Home'));
print anchor ('site/projectlist', $con->lang->line('Projects'));
if ($issysadmin)
print anchor ('user/admin', $con->lang->line('System'));
print anchor ('site/admin', $con->lang->line('System'));
print '</div>';
print '</div>';

View File

@ -8,7 +8,19 @@
<title><?=htmlspecialchars($wiki->name)?></title>
</head>
<body>
<script type="text/javascript">
function render_wiki()
{
creole_render_wiki (
"project_wiki_show_textpre",
"project_wiki_show_textarea",
"<?=site_url()?>/wiki/show/<?=$project->id?>/"
);
}
</script>
<body onLoad="render_wiki()">
<div class="content" id="project_wiki_show_content">
@ -65,14 +77,6 @@ $this->load->view (
</div> <!-- project_wiki_show_content -->
<script type="text/javascript">
creole_render_wiki (
"project_wiki_show_textpre",
"project_wiki_show_textarea",
""
);
</script>
</body>
</html>

View File

@ -29,10 +29,9 @@ function load_ini ($file)
array ('sysadmin_userids', 'string', ''),
array ('max_upload_size', 'string', '10000'), // kbytes
array ('max_latest_projects', 'integer', 10),
array ('max_site_logs_per_page', 'integer', 50),
array ('max_svn_commits', 'integer', 10),
array ('max_svn_commits_in_project', 'integer', 5),
array ('max_logs_per_page', 'integer', 50),
array ('max_logs_in_site_home', 'integer', 10),
array ('max_logs_in_project_home', 'integer', 5),
array ('database_username', 'string', ''),
array ('database_password', 'string', ''),

View File

@ -3,98 +3,99 @@
*/
/*-----------------------------------------------
* user home view
* log view
*-----------------------------------------------*/
#user_home_mainarea_sidebar {
width: 24em;
}
#user_home_mainarea_sidebar_log_table {
border-collapse: collapse;
}
#user_home_mainarea_sidebar_log_table tr.odd {
background-color: #bbccef;
}
#user_home_mainarea_sidebar_log_table tr.odd td {
white-space: nowrap;
}
#user_home_mainarea_sidebar_log_table tr.odd td.date {
width: 1px;
}
#user_home_mainarea_sidebar_log_table tr.even {
background-color: inherit;
}
#user_home_mainarea_sidebar_log_table tr.even .description {
font-style: italic;
}
#user_home_mainarea_sidebar_log_table tr.even pre.message {
border: 0;
margin: 1px;
background-color: inherit;
white-space: pre-wrap;
}
/*-----------------------------------------------
* user sidelog view
*-----------------------------------------------*/
#user_sitelog_mainarea_result {
#log_mainarea_result {
overflow: auto;
}
#user_sitelog_mainarea_result_table {
#log_mainarea_result_table {
border-collapse: collapse;
}
#user_sitelog_mainarea_result_table a {
#log_mainarea_result_table a {
text-decoration: none;
}
#user_sitelog_mainarea_result_table td {
#log_mainarea_result_table td {
vertical-align: top;
white-space: nowrap;
}
#user_sitelog_mainarea_result_table td.break {
#log_mainarea_result_table td.break {
font-size: 0.5em;
}
#user_sitelog_mainarea_result_table td.date {
#log_mainarea_result_table td.date {
font-weight: bold;
background-color: #bbccef;
}
#user_sitelog_mainarea_result_table td.time {
#log_mainarea_result_table td.time {
width: 1px;
color: #777777;
}
#user_sitelog_mainarea_result_table td.details {
#log_mainarea_result_table td.details {
white-space: normal;
}
#user_sitelog_mainarea_result_table td.details .description {
#log_mainarea_result_table td.details .description {
/*font-style: italic;*/
}
#user_sitelog_mainarea_result_table td.details pre.message {
#log_mainarea_result_table td.details pre.message {
border: 0;
margin: 1px;
background-color: inherit;
white-space: pre-wrap;
}
#user_sitelog_mainarea_result_table td.pages {
#log_mainarea_result_table td.pages {
padding-top: 1em;
text-align: center;
font-weight: bold;
}
/*-----------------------------------------------
* user home view
*-----------------------------------------------*/
#site_home_mainarea_sidebar {
width: 24em;
}
#site_home_mainarea_sidebar_log_table {
border-collapse: collapse;
}
#site_home_mainarea_sidebar_log_table tr.odd {
background-color: #bbccef;
}
#site_home_mainarea_sidebar_log_table tr.odd td {
white-space: nowrap;
}
#site_home_mainarea_sidebar_log_table tr.odd td.date {
width: 1px;
}
#site_home_mainarea_sidebar_log_table tr.even {
background-color: inherit;
}
#site_home_mainarea_sidebar_log_table tr.even .description {
font-style: italic;
}
#site_home_mainarea_sidebar_log_table tr.even pre.message {
border: 0;
margin: 1px;
background-color: inherit;
white-space: pre-wrap;
}
/*-----------------------------------------------
* project home view
*-----------------------------------------------*/
@ -116,12 +117,10 @@
#project_home_mainarea_sidebar_log_table tr.even {
background-color: inherit;
/*font-size: 0.9em;*/
font-style: italic;
}
#project_home_mainarea_sidebar_log_table tr.even .description {
/*font-style: italic;*/
font-style: italic;
}
#project_home_mainarea_sidebar_log_table tr.even pre.message {

View File

@ -67,7 +67,7 @@ if ($rev != $youngest) {
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -79,7 +79,7 @@ if (!@$_REQUEST["manualorder"] && is_numeric($rev1) && is_numeric($rev2)) {
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -81,7 +81,7 @@ if ($rev != $youngest) {
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -128,7 +128,7 @@ createDirLinks($rep, $ppath, $passrev);
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -741,7 +741,7 @@ class WebSvnConfig {
$codepot_base = dirname(dirname($_SERVER['PHP_SELF']));
if ($codepot_base == '/') $codepot_base = '';
if ($op == 'codepot_userhome')
$url = "{$codepot_base}/index.php/user/home";
$url = "{$codepot_base}/index.php/site/home";
else if ($op == 'codepot_projectlist')
$url = "{$codepot_base}/index.php/user/projectlist";
else if ($op == 'codepot_index' || $op == 'index') {

View File

@ -108,7 +108,7 @@ if ($config->flatIndex) {
}
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -302,7 +302,7 @@ $vars['logurl'] = $logurl.'rev='.$passrev.'&amp;isdir=1';
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -109,7 +109,7 @@ createDirLinks($rep, $ppath, $passrev);
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -131,7 +131,7 @@ $vars['logurl'] = $logurl.'rev='.$passrev.'&amp;isdir=1';
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');
$vars['codepot_userhomeurl'] = $config->getURL($rep, '', 'codepot_userhome');
$vars['codepot_sitehomeurl'] = $config->getURL($rep, '', 'codepot_sitehome');
$vars['codepot_projectlisturl'] = $config->getURL($rep, '', 'codepot_projectlist');
$vars['codepot_indexurl'] = $config->getURL($rep, '', 'codepot_index');
$vars['codepot_wikiurl'] = $config->getURL($rep, '', 'codepot_wiki');

View File

@ -7,7 +7,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>

View File

@ -9,7 +9,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>

View File

@ -10,7 +10,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>

View File

@ -7,7 +7,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>

View File

@ -7,7 +7,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>

View File

@ -7,7 +7,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>

View File

@ -7,7 +7,7 @@
</div>
<div class="boxa">
<a href="[websvn:codepot_userhomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_sitehomeurl]">[lang:HOME]</a>
<a href="[websvn:codepot_projectlisturl]">[lang:PROJECTS]</a>
</div>
</div>