finished the extended wiki editing view

This commit is contained in:
hyung-hwan 2016-01-12 18:13:00 +00:00
parent 880645f628
commit f9372bc636
29 changed files with 1029 additions and 1041 deletions

View File

@ -44,7 +44,7 @@ CREATE TABLE wiki (
projectid VARCHAR(32) NOT NULL,
name VARCHAR(255) NOT NULL,
text TEXT NOT NULL,
type CHAR(1) NOT NULL DEFAULT 'C',
doctype CHAR(1) NOT NULL DEFAULT 'C',
columns INT NOT NULL DEFAULT 1,
createdon DATETIME NOT NULL,

View File

@ -62,7 +62,7 @@ CREATE TABLE "cpot_wiki" (
"projectid" VARCHAR(32) NOT NULL,
"name" VARCHAR(255) NOT NULL,
"text" CLOB NOT NULL,
"type" CHAR(1) DEFAULT 'C' NOT NULL,
"doctype" CHAR(1) DEFAULT 'C' NOT NULL,
"columns" INT DEFAULT 1 NOT NULL,
"createdon" TIMESTAMP NOT NULL,
"updatedon" TIMESTAMP NOT NULL,

View File

@ -60,7 +60,7 @@ CREATE TABLE wiki (
projectid VARCHAR(32) NOT NULL,
name VARCHAR(255) NOT NULL,
text TEXT NOT NULL,
type CHAR(1) NOT NULL DEFAULT 'C',
doctype CHAR(1) NOT NULL DEFAULT 'C',
columns INT NOT NULL DEFAULT 1,
createdon TIMESTAMP NOT NULL,

View File

@ -5,7 +5,6 @@ class File extends Controller
var $VIEW_ERROR = 'error';
var $VIEW_HOME = 'file_home';
var $VIEW_SHOW = 'file_show';
var $VIEW_EDIT = 'file_edit';
function File ()
{
@ -237,108 +236,6 @@ class File extends Controller
}
}
/*
// DEPRECATED
function update ($projectid = '', $name = '')
{
$this->load->helper ('form');
$this->load->library ('form_validation');
$this->load->model ('ProjectModel', 'projects');
$this->load->model ('FileModel', 'files');
$login = $this->login->getUser ();
if ($login['id'] == '')
redirect ("main/signin/" . $this->converter->AsciiTohex(current_url()));
$data['login'] = $login;
$name = $this->converter->HexToAscii ($name);
$project = $this->projects->get ($projectid);
if ($project === FALSE)
{
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($project === NULL)
{
$data['message'] =
$this->lang->line('MSG_NO_SUCH_PROJECT') .
" - {$projectid}";
$this->load->view ($this->VIEW_ERROR, $data);
}
else if (!$login['sysadmin?'] &&
$this->projects->projectHasMember($project->id, $login['id']) === FALSE)
{
$data['project'] = $project;
$data['message'] = sprintf (
$this->lang->line('MSG_PROJECT_MEMBERSHIP_REQUIRED'), $projectid);
$this->load->view ($this->VIEW_ERROR, $data);
}
else
{
$this->form_validation->set_rules (
'file_name', 'name', 'required|max_length[255]');
$this->form_validation->set_rules (
'file_tag', 'tag', 'required|max_length[50]');
$this->form_validation->set_rules (
'file_description', 'description', 'required');
$this->form_validation->set_error_delimiters (
'<span class="form_field_error">','</span>');
$data['message'] = '';
$data['project'] = $project;
if ($this->input->post('file'))
{
$file = new stdClass();
$file->name = $this->input->post('file_name');
$file->tag = $this->input->post('file_tag');
$file->description = $this->input->post('file_description');
if ($this->form_validation->run())
{
if ($this->files->update ($login['id'], $projectid, $name, $file) === FALSE)
{
$data['message'] = 'DATABASE ERROR';
$data['file'] = $file;
$this->load->view ($this->VIEW_EDIT, $data);
}
else
{
redirect ("file/show/{$project->id}/" . $this->converter->AsciiToHex($file->name));
}
}
else
{
$data['message'] = $this->lang->line('MSG_FORM_INPUT_INCOMPLETE');
$data['file'] = $file;
$this->load->view ($this->VIEW_EDIT, $data);
}
}
else
{
$file = $this->files->get ($login['id'], $project, $name);
if ($file === FALSE)
{
$data['message'] = 'DATABASE ERROR';
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($file == NULL)
{
$data['message'] = sprintf
($this->lang->line('FILE_MSG_NO_SUCH_FILE'), $name);
$this->load->view ($this->VIEW_ERROR, $data);
}
else
{
$data['file'] = $file;
$this->load->view ($this->VIEW_EDIT, $data);
}
}
}
}
*/
function xhr_import ($projectid = '')
{
$this->load->model ('ProjectModel', 'projects');

View File

@ -408,6 +408,7 @@ class Wiki extends Controller
$wiki->name = $name;
$wiki->text = '';
$wiki->columns = '1';
$wiki->attachments = array();
$data['wiki'] = $wiki;
$this->load->view ($view_edit, $data);
@ -907,10 +908,11 @@ class Wiki extends Controller
$wiki->projectid = $projectid;
$wiki->name = $this->input->post('wiki_name');
$wiki->text = $this->input->post('wiki_text');
$wiki->type = $this->input->post('wiki_type');
$wiki->doctype = $this->input->post('wiki_doctype');
$wiki->original_name = $this->input->post('wiki_original_name');
$wiki_file_count = $this->input->post('wiki_file_count');
$wiki_kill_file_count = $this->input->post('wiki_kill_file_count');
if ($wiki->name === FALSE || ($wiki->name = trim($wiki->name)) == '')
{
@ -927,6 +929,7 @@ class Wiki extends Controller
else
{
if ($wiki_file_count === FALSE || $wiki_file_count <= 0) $wiki_file_count = 0;
if ($wiki_kill_file_count === FALSE || $wiki_kill_file_count <= 0) $wiki_kill_file_count = 0;
if ($wiki->original_name === FALSE) $wiki->original_name = '';
else $wiki->original_name = trim($wiki->original_name);
@ -952,7 +955,17 @@ class Wiki extends Controller
if ($status == '')
{
if ($this->wikis->editWithFiles ($login['id'], $wiki, $attached_files, $this->upload) === FALSE)
$kill_files = array();
for ($i = 0; $i < $wiki_kill_file_count; $i++)
{
$n = $this->input->post("wiki_kill_file_name_{$i}");
if ($n != '') array_push ($kill_files, $n);
}
}
if ($status == '')
{
if ($this->wikis->editWithFiles ($login['id'], $wiki, $attached_files, $kill_files, $this->upload) === FALSE)
{
$status = 'error - ' . $this->wikis->getErrorMessage();
}

View File

@ -29,6 +29,7 @@ class FileModel extends Model
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback();
return FALSE;
}
@ -45,6 +46,7 @@ class FileModel extends Model
$query = $this->db->get('file_list');
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback();
return FALSE;
}
@ -79,6 +81,7 @@ class FileModel extends Model
$query = $this->db->get ('file');
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback();
return FALSE;
}
@ -94,6 +97,7 @@ class FileModel extends Model
$query = $this->db->get('file_list');
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback();
return FALSE;
}

View File

@ -297,6 +297,20 @@ class WikiModel extends Model
// TODO: check if userid can do this..
$this->db->trans_begin ();
$this->db->where ('projectid', $wiki->projectid);;
$this->db->where ('wikiname', $wiki->name);
$this->db->select ('encname');
$query = $this->db->get ('wiki_attachment');
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback ();
$this->delete_all_files ($ok_files);
return FALSE;
}
$file_result = $query->result ();
$this->db->where ('projectid', $wiki->projectid);
$this->db->where ('wikiname', $wiki->name);
$this->db->delete ('wiki_attachment');
@ -331,6 +345,11 @@ class WikiModel extends Model
return FALSE;
}
foreach ($file_result as $r)
{
@unlink (CODEPOT_ATTACHMENT_DIR . '/' . $r->encname);
}
$this->db->trans_commit ();
return TRUE;
}
@ -344,8 +363,12 @@ class WikiModel extends Model
return $x;
}
///////////////////////////////////////////////////////////////////
private function delete_all_files ($files)
{
foreach ($files as $f) @unlink ($f);
}
private function _edit_wiki ($userid, $wiki, $attached_files, $uploader)
private function _edit_wiki ($userid, $wiki, $attached_files, $kill_files, $uploader)
{
$this->db->trans_begin (); // manual transaction. not using trans_start().
@ -357,7 +380,7 @@ class WikiModel extends Model
$this->db->set ('projectid', $wiki->projectid);;
$this->db->set ('name', $wiki->name);
$this->db->set ('text', $wiki->text);
$this->db->set ('type', $wiki->type);
$this->db->set ('doctype', $wiki->doctype);
$this->db->set ('createdon', $now);
$this->db->set ('updatedon', $now);
$this->db->set ('createdby', $userid);
@ -370,7 +393,7 @@ class WikiModel extends Model
$this->db->where ('name', $wiki->original_name);
$this->db->set ('name', $wiki->name);
$this->db->set ('text', $wiki->text);
$this->db->set ('type', $wiki->type);
$this->db->set ('doctype', $wiki->doctype);
$this->db->set ('updatedon', $now);
$this->db->set ('updatedby', $userid);
$this->db->update ('wiki');
@ -447,15 +470,51 @@ class WikiModel extends Model
return FALSE;
}
if (!empty($kill_files))
{
$this->db->where ('projectid', $wiki->projectid);;
$this->db->where ('wikiname', $wiki->name);
$this->db->where_in ('name', $kill_files);
$this->db->select ('encname');
$query = $this->db->get ('wiki_attachment');
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback ();
$this->delete_all_files ($ok_files);
return FALSE;
}
$result = $query->result ();
$this->db->where ('projectid', $wiki->projectid);;
$this->db->where ('wikiname', $wiki->name);
$this->db->where_in ('name', $kill_files);
$this->db->delete ('wiki_attachment');
if ($this->db->trans_status() === FALSE)
{
$this->errmsg = $this->db->_error_message();
$this->db->trans_rollback ();
$this->delete_all_files ($ok_files);
return FALSE;
}
foreach ($result as $r)
{
@unlink (CODEPOT_ATTACHMENT_DIR . '/' . $r->encname);
}
}
$this->db->trans_commit ();
return $newid;
return TRUE;
}
function editWithFiles ($userid, $wiki, $attached_files, $uploader)
function editWithFiles ($userid, $wiki, $attached_files, $kill_files, $uploader)
{
set_error_handler (array ($this, 'capture_error'));
$errmsg = '';
$x = $this->_edit_wiki ($userid, $wiki, $attached_files, $uploader);
$x = $this->_edit_wiki ($userid, $wiki, $attached_files, $kill_files, $uploader);
restore_error_handler ();
return $x;
}

View File

@ -9,7 +9,6 @@ www_DATA = \
code_history.php \
code_revision.php \
code_search.php \
file_edit.php \
file_home.php \
file_show.php \
footer.php \

View File

@ -154,7 +154,6 @@ www_DATA = \
code_history.php \
code_revision.php \
code_search.php \
file_edit.php \
file_home.php \
file_show.php \
footer.php \

View File

@ -281,33 +281,33 @@ $this->load->view (
<div class="result" id="code_blame_result">
<?php
$fileext = substr(strrchr($file['name'], '.'), 1);
if ($fileext == 'adb' || $fileext == 'ads') $fileext = 'ada';
else if ($fileext == 'pas') $fileext = 'pascal';
else if ($fileext == 'bas') $fileext = 'basic';
<?php
$fileext = substr(strrchr($file['name'], '.'), 1);
if ($fileext == 'adb' || $fileext == 'ads') $fileext = 'ada';
else if ($fileext == 'pas') $fileext = 'pascal';
else if ($fileext == 'bas') $fileext = 'basic';
$prettyprint_lang = ($fileext != '')? "lang-$fileext": '';
$prettyprint_lang = ($fileext != '')? "lang-$fileext": '';
$prettyprint_linenums = 'linenums';
if ($login['settings'] != NULL &&
$login['settings']->code_hide_line_num == 'Y') $prettyprint_linenums = '';
?>
$prettyprint_linenums = 'linenums';
if ($login['settings'] != NULL &&
$login['settings']->code_hide_line_num == 'Y') $prettyprint_linenums = '';
?>
<pre id="code_blame_result_code_container" class="line-numbered">
<?php
// when producing line-numbered code, make sure to produce proper
// line terminators.
//
// the <code> </code> block requires \n after every line.
// while the <span></span> block to contain revision numbers and authors
// doesn't require \n. It is because the css file sets the line-number span
// to display: block.
//
// If you have new lines between <span></span> and <code></code>, there will
// be some positioning problems as thouse new lines are rendered at the top
// of the actual code.
//
<pre id="code_blame_result_code_container" class="line-numbered">
<?php
// when producing line-numbered code, make sure to produce proper
// line terminators.
//
// the <code> </code> block requires \n after every line.
// while the <span></span> block to contain revision numbers and authors
// doesn't require \n. It is because the css file sets the line-number span
// to display: block.
//
// If you have new lines between <span></span> and <code></code>, there will
// be some positioning problems as thouse new lines are rendered at the top
// of the actual code.
//
$content = &$file['content'];
$len = count($content);
@ -400,17 +400,17 @@ if ($login['settings'] != NULL &&
}
print '</code>';
?>
</pre>
?>
</pre>
<div id="code_blame_mainarea_loc_info" class="infobox">
<div class="title">LOC</div>
<?php
<div id="code_blame_mainarea_loc_info" class="infobox">
<div class="title">LOC</div>
<?php
/* TODO: show this if it's enabled in the user settings */
$graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$hex_headpath}{$revreq}");
print "<img src='{$graph_url}' id='code_blame_mainarea_loc_info_locgraph' />";
?>
</div> <!-- code_blame_mainarea_loc_info -->
?>
</div> <!-- code_blame_mainarea_loc_info -->
</div> <!-- code_blame_result -->

View File

@ -215,7 +215,6 @@ $this->load->view (
</div>
<div id='code_diff_metadata_container'>
<div id='code_diff_metadata_against' class='collapsible-box'>
<div id='code_diff_metadata_against_header' class='collapsible-box-header'>
<?php
@ -291,7 +290,7 @@ $this->load->view (
if ($fileext == "") $fileext = "html"
?>
<div class="result" id="code_diff_result">
<div id="code_diff_result" class="result">
<?php
function format_diff2 ($a, $b, $css_class)
{

View File

@ -310,47 +310,47 @@ $this->load->view (
<div style="clear: both;"></div>
</div>
<div class="result" id="code_edit_result">
<div id="code_edit_result" class="result">
<?php
/*
$fileext = substr(strrchr($file['name'], '.'), 1);
if ($fileext == 'adb' || $fileext == 'ads') $fileext = 'ada';
else if ($fileext == 'pas') $fileext = 'pascal';
else if ($fileext == 'bas') $fileext = 'basic';
*/
?>
<?php
/*
$fileext = substr(strrchr($file['name'], '.'), 1);
if ($fileext == 'adb' || $fileext == 'ads') $fileext = 'ada';
else if ($fileext == 'pas') $fileext = 'pascal';
else if ($fileext == 'bas') $fileext = 'basic';
*/
?>
<div id="code_edit_result_code"><?php
/*
$is_octet_stream = FALSE;
if (array_key_exists('properties', $file) && count($file['properties']) > 0)
{
foreach ($file['properties'] as $pn => $pv)
<div id="code_edit_result_code"><?php
/*
$is_octet_stream = FALSE;
if (array_key_exists('properties', $file) && count($file['properties']) > 0)
{
if ($pn == 'svn:mime-type' && $pv == 'application/octet-stream')
foreach ($file['properties'] as $pn => $pv)
{
$is_octet_stream = TRUE;
break;
if ($pn == 'svn:mime-type' && $pv == 'application/octet-stream')
{
$is_octet_stream = TRUE;
break;
}
}
}
}
$is_image_stream = FALSE;
if ($is_octet_stream ||
in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico')))
{
$img = @imagecreatefromstring ($file['content']);
if ($img !== FALSE)
$is_image_stream = FALSE;
if ($is_octet_stream ||
in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico')))
{
@imagedestroy ($img);
print ('<img src="data:image;base64,' . base64_encode ($file['content']) . '" alt="[image]" />');
$is_image_stream = TRUE;
$img = @imagecreatefromstring ($file['content']);
if ($img !== FALSE)
{
@imagedestroy ($img);
print ('<img src="data:image;base64,' . base64_encode ($file['content']) . '" alt="[image]" />');
$is_image_stream = TRUE;
}
}
}
if (!$is_image_stream)*/ print htmlspecialchars($file['content']);
?></div>
if (!$is_image_stream)*/ print htmlspecialchars($file['content']);
?></div>
</div> <!-- code_edit_result -->

View File

@ -985,7 +985,7 @@ $this->load->view (
?>
</div>
<div class="result" id="code_folder_result">
<div id="code_folder_result" class="result" >
<?php
function comp_files ($a, $b)
{

View File

@ -92,7 +92,7 @@ $this->load->view (
<div style="clear: both;"></div>
</div>
<div class="graph" id="code_history_mainarea_graph">
<div class="graph" id="code_history_graph">
<?php
$xfullpath = $this->converter->AsciiToHex (($fullpath == '')? '.': $fullpath);
@ -102,108 +102,107 @@ $this->load->view (
$graph_url = codepot_merge_path (site_url(), "/code/graph/commit-share-by-users/{$project->id}/{$xfullpath}{$revreq}");
print "<img src='{$graph_url}' />";
?>
</div> <!-- code_history_mainarea_graph -->
<div class="result" id="code_history_result">
</div> <!-- code_history_graph -->
<table id="code_history_result_table" class="full-width-result-table">
<tr class='full-width-result-table-header'>
<th><?php print $this->lang->line('Revision')?></th>
<th><?php print $this->lang->line('Committer')?></th>
<th><?php print $this->lang->line('Date')?></th>
<th><?php print $this->lang->line('Message')?></th>
<?php if ($file['type'] == 'file' || $file['type'] == 'dir') print '<th></th>'; ?>
</tr>
<?php
$rowclasses = array ('even', 'odd');
$history = $file['history'];
$history_count = count($history);
$curfullpath = $fullpath;
for ($i = $history_count; $i > 0; )
{
$h = $history[--$i];
$rowclass = $rowclasses[($history_count - $i) % 2];
print "<tr class='{$rowclass}'>";
print '<td class="commit-revision-td">';
$xfullpath = $this->converter->AsciiToHex (
($fullpath == '')? '.': $fullpath);
print anchor ("code/file/{$project->id}/{$xfullpath}/{$h['rev']}", $h['rev']);
if (!empty($h['tag']))
<div id="code_history_result" class="result">
<table id="code_history_result_table" class="full-width-result-table">
<tr class='full-width-result-table-header'>
<th><?php print $this->lang->line('Revision')?></th>
<th><?php print $this->lang->line('Committer')?></th>
<th><?php print $this->lang->line('Date')?></th>
<th><?php print $this->lang->line('Message')?></th>
<?php if ($file['type'] == 'file' || $file['type'] == 'dir') print '<th></th>'; ?>
</tr>
<?php
$rowclasses = array ('even', 'odd');
$history = $file['history'];
$history_count = count($history);
$curfullpath = $fullpath;
for ($i = $history_count; $i > 0; )
{
print ' ';
print '<span class="left_arrow_indicator">';
print htmlspecialchars($h['tag']);
print '</span>';
}
print '</td>';
$h = $history[--$i];
print '<td class="commit-author-td">';
// Repository migration from googlecode revealed that it did not put
// 'author' for initial project creation. So I've added the following check.
if (array_key_exists('author', $h)) print htmlspecialchars($h['author']);
print '</td>';
$rowclass = $rowclasses[($history_count - $i) % 2];
print "<tr class='{$rowclass}'>";
print '<td class="commit-date-td"><code>';
print strftime('%Y-%m-%d', strtotime($h['date']));
print '</code></td>';
print '<td class="commit-revision-td">';
$xfullpath = $this->converter->AsciiToHex (
($fullpath == '')? '.': $fullpath);
print '<td class="commit-message-td">';
print anchor ("code/revision/{$project->id}/{$xfullpath}/{$h['rev']}", htmlspecialchars($h['msg']), "class='commit-message'");
//print '<pre class="pre-wrapped">';
//print htmlspecialchars($h['msg']);
//print '</pre>';
print '</td>';
print anchor ("code/file/{$project->id}/{$xfullpath}/{$h['rev']}", $h['rev']);
print '<td>';
if ($file['type'] == 'file')
{
print anchor ("code/blame/{$project->id}/{$xfullpath}/{$h['rev']}",
'<i class="fa fa-bomb"></i> ' . $this->lang->line('Blame'));
print ' | ';
print anchor ("code/diff/{$project->id}/{$xfullpath}/{$h['rev']}",
'<i class="fa fa-server"></i> ' . $this->lang->line('Difference'));
}
print '</td>';
print '</tr>';
//
// let's track the copy path.
//
$paths = $h['paths'];
$colspan = 6;
foreach ($paths as $p)
{
if (array_key_exists ('copyfrom', $p) &&
$p['action'] == 'A')
if (!empty($h['tag']))
{
$d = $curfullpath;
$f = '';
print ' ';
print '<span class="left_arrow_indicator">';
print htmlspecialchars($h['tag']);
print '</span>';
}
print '</td>';
while ($d != '/' && $d != '')
print '<td class="commit-author-td">';
// Repository migration from googlecode revealed that it did not put
// 'author' for initial project creation. So I've added the following check.
if (array_key_exists('author', $h)) print htmlspecialchars($h['author']);
print '</td>';
print '<td class="commit-date-td"><code>';
print strftime('%Y-%m-%d', strtotime($h['date']));
print '</code></td>';
print '<td class="commit-message-td">';
print anchor ("code/revision/{$project->id}/{$xfullpath}/{$h['rev']}", htmlspecialchars($h['msg']), "class='commit-message'");
//print '<pre class="pre-wrapped">';
//print htmlspecialchars($h['msg']);
//print '</pre>';
print '</td>';
print '<td>';
if ($file['type'] == 'file')
{
print anchor ("code/blame/{$project->id}/{$xfullpath}/{$h['rev']}",
'<i class="fa fa-bomb"></i> ' . $this->lang->line('Blame'));
print ' | ';
print anchor ("code/diff/{$project->id}/{$xfullpath}/{$h['rev']}",
'<i class="fa fa-server"></i> ' . $this->lang->line('Difference'));
}
print '</td>';
print '</tr>';
//
// let's track the copy path.
//
$paths = $h['paths'];
$colspan = 6;
foreach ($paths as $p)
{
if (array_key_exists ('copyfrom', $p) &&
$p['action'] == 'A')
{
if ($d == $p['path'])
{
$curfullpath = $p['copyfrom'] . $f;
print "<tr class='title'><td colspan='{$colspan}'>{$curfullpath}</td></tr>";
break;
}
$d = $curfullpath;
$f = '';
$d = dirname ($d);
$f = substr ($curfullpath, strlen($d));
while ($d != '/' && $d != '')
{
if ($d == $p['path'])
{
$curfullpath = $p['copyfrom'] . $f;
print "<tr class='title'><td colspan='{$colspan}'>{$curfullpath}</td></tr>";
break;
}
$d = dirname ($d);
$f = substr ($curfullpath, strlen($d));
}
}
}
}
}
?>
</table>
</div> <!-- code_history_mainarea_body -->
}
?>
</table>
</div> <!-- code_history_result -->
</div> <!-- code_history_mainarea -->

View File

@ -639,9 +639,6 @@ $history = $file['history'];
<div style="clear: both;"></div>
</div>
<div id="code_revision_metadata" class="collapsible-box">
<div id="code_revision_metadata_header" class="collapsible-box-header" >
<?php
@ -678,161 +675,160 @@ $history = $file['history'];
</div>
</div>
<div class="result" id="code_revision_result">
<div id="code_revision_result" class="result">
<div id="code_revision_result_files" class="collapsible-box">
<div class="collapsible-box-header"><?php print $this->lang->line('Files')?></div>
<div id="code_revision_result_files_table_container" class="collapsible-box-panel">
<table id="code_revision_result_files_table" class="fit-width-result-table">
<?php
/*
print '<tr class="heading">';
print '<th>' . $this->lang->line('Path') . '</th>';
print '<th></th>';
print '</tr>';
*/
$diff_anchor_text = '<i class="fa fa-server"></i> ' . $this->lang->line('Difference');
$fulldiff_anchor_text = '<i class="fa fa-tasks"></i> ' . $this->lang->line('Full Difference');
<div id="code_revision_result_files" class="collapsible-box">
<div class="collapsible-box-header"><?php print $this->lang->line('Files')?></div>
<div id="code_revision_result_files_table_container" class="collapsible-box-panel">
<table id="code_revision_result_files_table" class="fit-width-result-table">
<?php
/*
print '<tr class="heading">';
print '<th>' . $this->lang->line('Path') . '</th>';
print '<th></th>';
print '</tr>';
*/
$diff_anchor_text = '<i class="fa fa-server"></i> ' . $this->lang->line('Difference');
$fulldiff_anchor_text = '<i class="fa fa-tasks"></i> ' . $this->lang->line('Full Difference');
$rowclasses = array ('odd', 'even');
$rowcount = 0;
foreach ($history['paths'] as &$p)
{
$rowclass = $rowclasses[++$rowcount % 2];
print "<tr class='{$rowclass}'>";
$rowclasses = array ('odd', 'even');
$rowcount = 0;
foreach ($history['paths'] as &$p)
{
$rowclass = $rowclasses[++$rowcount % 2];
print "<tr class='{$rowclass}'>";
$xpar = $this->converter->AsciiToHex ($p['path']);
$xpar = $this->converter->AsciiToHex ($p['path']);
print "<td class='{$p['action']}'>";
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
print '</td>';
print "<td class='{$p['action']}'>";
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
print '</td>';
print '<td>';
//print anchor ("code/blame/{$project->id}/{$xpar}/{$history['rev']}", $this->lang->line('Blame'));
//print ' ';
print anchor ("code/diff/{$project->id}/{$xpar}/{$history['rev']}", $diff_anchor_text);
print '</td>';
print '<td>';
//print anchor ("code/blame/{$project->id}/{$xpar}/{$history['rev']}", $this->lang->line('Blame'));
//print ' ';
print anchor ("code/diff/{$project->id}/{$xpar}/{$history['rev']}", $diff_anchor_text);
print '</td>';
print '<td>';
print anchor ("code/fulldiff/{$project->id}/{$xpar}/{$history['rev']}", $fulldiff_anchor_text);
print '</td>';
print '<td>';
print anchor ("code/fulldiff/{$project->id}/{$xpar}/{$history['rev']}", $fulldiff_anchor_text);
print '</td>';
print '</tr>';
}
?>
</table>
</div>
</div>
print '</tr>';
}
?>
</table>
</div>
</div>
<div id="code_revision_result_properties" class="collapsible-box">
<div class="collapsible-box-header"><?php print $this->lang->line('CODE_PROPERTIES');?></div>
<div id="code_revision_result_properties_table_container" class="collapsible-box-panel">
<table id="code_revision_result_properties_table" class="fit-width-result-table">
<?php
$rowclasses = array ('odd', 'even');
$rowcount = 0;
foreach ($history['paths'] as &$p)
{
if (array_key_exists('props', $p) && array_key_exists('prev_props', $p))
{
$common_props = array_intersect_assoc ($p['props'], $p['prev_props']);
$added_props = array_diff_assoc ($p['props'], $common_props);
$deleted_props = array_diff_assoc ($p['prev_props'], $common_props);
if (count($added_props) > 0 || count($deleted_props) > 0)
<div class="collapsible-box-header"><?php print $this->lang->line('CODE_PROPERTIES');?></div>
<div id="code_revision_result_properties_table_container" class="collapsible-box-panel">
<table id="code_revision_result_properties_table" class="fit-width-result-table">
<?php
$rowclasses = array ('odd', 'even');
$rowcount = 0;
foreach ($history['paths'] as &$p)
{
$rowclass = $rowclasses[++$rowcount % 2];
$first = TRUE;
foreach ($added_props as $k => $v)
if (array_key_exists('props', $p) && array_key_exists('prev_props', $p))
{
print "<tr class='{$rowclass}'>";
if ($first)
$common_props = array_intersect_assoc ($p['props'], $p['prev_props']);
$added_props = array_diff_assoc ($p['props'], $common_props);
$deleted_props = array_diff_assoc ($p['prev_props'], $common_props);
if (count($added_props) > 0 || count($deleted_props) > 0)
{
print "<td class='{$p['action']}'>";
$xpar = $this->converter->AsciiToHex ($p['path']);
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
$first = FALSE;
$rowclass = $rowclasses[++$rowcount % 2];
$first = TRUE;
foreach ($added_props as $k => $v)
{
print "<tr class='{$rowclass}'>";
if ($first)
{
print "<td class='{$p['action']}'>";
$xpar = $this->converter->AsciiToHex ($p['path']);
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
$first = FALSE;
}
else print "<td>";
print '</td>';
print '<td class="A">';
printf ('%s - %s', htmlspecialchars($k), htmlspecialchars($v));
print '</td>';
print '</tr>';
}
foreach ($deleted_props as $k => $v)
{
print "<tr class='{$rowclass}'>";
if ($first)
{
print "<td class='{$p['action']}'>";
$xpar = $this->converter->AsciiToHex ($p['path']);
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
$first = FALSE;
}
else print "<td>";
print '</td>';
print '<td class="D">';
printf ('%s - %s', htmlspecialchars($k), htmlspecialchars($v));
print '</td>';
print '</tr>';
}
}
else print "<td>";
print '</td>';
print '<td class="A">';
printf ('%s - %s', htmlspecialchars($k), htmlspecialchars($v));
print '</td>';
print '</tr>';
}
foreach ($deleted_props as $k => $v)
{
print "<tr class='{$rowclass}'>";
if ($first)
{
print "<td class='{$p['action']}'>";
$xpar = $this->converter->AsciiToHex ($p['path']);
print anchor ("code/file/{$project->id}/{$xpar}/{$history['rev']}", htmlspecialchars($p['path']));
$first = FALSE;
}
else print "<td>";
print '</td>';
print '<td class="D">';
printf ('%s - %s', htmlspecialchars($k), htmlspecialchars($v));
print '</td>';
print '</tr>';
}
}
}
}
?>
</table>
</div>
?>
</table>
</div>
</div>
<div id="code_revision_result_comments" class="collapsible-box">
<div class="collapsible-box-header"><?php print $this->lang->line('Comment')?>&nbsp;
<?php if ($is_loggedin): ?>
<span class='anchor'>
<?php print anchor ("#", $this->lang->line('New'),
array ('id' => 'code_revision_new_review_comment_button'));
?>
</span>
<?php endif; ?>
</div>
<div class="collapsible-box-header"><?php print $this->lang->line('Comment')?>&nbsp;
<?php if ($is_loggedin): ?>
<span class='anchor'>
<?php print anchor ("#", $this->lang->line('New'),
array ('id' => 'code_revision_new_review_comment_button'));
?>
</span>
<?php endif; ?>
</div>
<div id="code_revision_mainarea_review_comment" class="collapsible-box-panel">
<?php
for ($i = 0; $i < $review_count; )
{
$rc = $reviews[$i];
$i++;
print "<div id='code_revision_mainarea_review_comment_title_{$i}' class='review_comment_title'>\n";
printf (" <span class='review_comment_title_no'>%d</span>", $rc->sno);
printf (" <span class='review_comment_title_updatedby'>%s</span>", $rc->updatedby);
printf (" <span class='review_comment_title_updatedon'>%s</span>", codepot_dbdatetodispdate($rc->updatedon));
if ($login['id'] == $rc->updatedby)
<div id="code_revision_mainarea_review_comment" class="collapsible-box-panel">
<?php
for ($i = 0; $i < $review_count; )
{
print '&nbsp;';
print anchor (
"#", $this->lang->line('Edit'),
array ('id' => 'code_revision_edit_review_comment_button_' . $i)
);
$rc = $reviews[$i];
$i++;
print "<div id='code_revision_mainarea_review_comment_title_{$i}' class='review_comment_title'>\n";
printf (" <span class='review_comment_title_no'>%d</span>", $rc->sno);
printf (" <span class='review_comment_title_updatedby'>%s</span>", $rc->updatedby);
printf (" <span class='review_comment_title_updatedon'>%s</span>", codepot_dbdatetodispdate($rc->updatedon));
if ($login['id'] == $rc->updatedby)
{
print '&nbsp;';
print anchor (
"#", $this->lang->line('Edit'),
array ('id' => 'code_revision_edit_review_comment_button_' . $i)
);
}
print ("</div>\n");
print "<div id='code_revision_mainarea_review_comment_{$i}' class='review_comment_text'>\n";
print "<pre id='code_revision_mainarea_review_comment_text_{$i}' style='visibility: hidden'>\n";
print htmlspecialchars($rc->comment);
print "</pre>\n";
print "</div>\n";
}
print ("</div>\n");
print "<div id='code_revision_mainarea_review_comment_{$i}' class='review_comment_text'>\n";
print "<pre id='code_revision_mainarea_review_comment_text_{$i}' style='visibility: hidden'>\n";
print htmlspecialchars($rc->comment);
print "</pre>\n";
print "</div>\n";
}
?>
</div> <!-- code_revision_mainarea_review_comment -->
?>
</div>
</div> <!-- code_revision_result_comments -->
</div> <!-- code_revision_result -->

View File

@ -1,134 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="<?php print base_url_make('/js/codepot.js')?>"></script>
<link type="text/css" rel="stylesheet" href="<?php print base_url_make('/css/common.css')?>" />
<link type="text/css" rel="stylesheet" href="<?php print base_url_make('/css/file.css')?>" />
<link type="text/css" rel="stylesheet" href="<?php print base_url_make('/css/font-awesome.min.css')?>" />
<script type="text/javascript" src="<?php print base_url_make('/js/creole.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/prettify/prettify.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/prettify/lang-css.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/prettify/lang-lisp.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/prettify/lang-lua.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/prettify/lang-sql.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/prettify/lang-vb.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/jquery.min.js')?>"></script>
<script type="text/javascript" src="<?php print base_url_make('/js/jquery-ui.min.js')?>"></script>
<link type="text/css" rel="stylesheet" href="<?php print base_url_make('/css/jquery-ui.css')?>" />
<script type="text/javascript">
function render_wiki(input_text)
{
creole_render_wiki_with_input_text (
input_text,
"file_edit_mainarea_description_preview",
"<?php print site_url()?>/wiki/show/<?php print $project->id?>/",
"<?php print site_url()?>/wiki/attachment0/<?php print $project->id?>/"
);
prettyPrint ();
}
$(function () {
$("#file_edit_mainarea_description_preview_button").button().click(
function () {
render_wiki ($("#file_edit_mainarea_description").val());
}
);
});
</script>
<title><?php print htmlspecialchars($file->name)?></title>
</head>
<body>
<div class="content">
<!---------------------------------------------------------------------------->
<?php $this->load->view ('taskbar'); ?>
<!---------------------------------------------------------------------------->
<?php
$this->load->view (
'projectbar',
array (
'banner' => NULL,
'page' => array (
'type' => 'project',
'id' => 'file',
'project' => $project,
),
'ctxmenuitems' => array ()
)
);
?>
<!---------------------------------------------------------------------------->
<div class="mainarea" id="file_mainarea">
<?php if ($message != "") print '<div id="file_message" class="form_message">'.htmlspecialchars($message).'</div>'; ?>
<div class="form_container">
<?php print form_open_multipart("file/update/{$project->id}/" . $this->converter->AsciiToHex($file->name))?>
<div class='form_input_field'>
<?php
print form_label($this->lang->line('Name').': ', 'file_name');
print form_input('file_name', set_value('file_name', $file->name), 'maxlength="255" size="40"');
?>
<?php print form_error('file_name');?>
</div>
<div class='form_input_field'>
<?php print form_label($this->lang->line('Tag').': ', 'file_tag')?>
<?php
$extra = 'maxlength="50" size="25"';
?>
<?php print form_input('file_tag', set_value('file_tag', $file->tag), $extra)?>
<?php print form_error('file_tag');?>
</div>
<div class='form_input_label'>
<?php print form_label($this->lang->line('Description').': ', 'file_description')?>
<a href='#' id='file_edit_mainarea_description_preview_button'><?php print $this->lang->line('Preview')?></a>
<?php print form_error('file_description');?>
</div>
<div class='form_input_field'>
<?php print form_textarea('file_description', set_value('file_description', $file->description), 'id=file_edit_mainarea_description')?>
</div>
<div id='file_edit_mainarea_description_preview' class='form_input_preview'></div>
<?php print form_submit('file', $this->lang->line('Update')); ?>
<?php print form_close();?>
</div>
</div> <!-- file_mainarea -->
<div class='footer-pusher'></div> <!-- for sticky footer -->
</div> <!-- content -->
<!---------------------------------------------------------------------------->
<?php $this->load->view ('footer'); ?>
<!---------------------------------------------------------------------------->
</body>
</html>

View File

@ -27,7 +27,7 @@
function show_alert (outputMsg, titleMsg)
{
$('#file_home_mainarea_alert').html(outputMsg).dialog({
$('#file_home_alert').html(outputMsg).dialog({
title: titleMsg,
resizable: true,
modal: true,
@ -45,7 +45,7 @@ function render_wiki(input_text)
{
creole_render_wiki_with_input_text (
input_text,
"file_home_mainarea_new_description_preview",
"file_home_new_description_preview",
"<?php print site_url()?>/wiki/show/<?php print $project->id?>/",
"<?php print site_url()?>/wiki/attachment0/<?php print $project->id?>/"
);
@ -65,15 +65,15 @@ function populate_selected_files ()
var f = populated_file_obj[n];
if (f != null)
{
var d = $('#file_home_mainarea_new_file_desc_' + n);
var d = $('#file_home_new_file_desc_' + n);
if (d != null) file_desc[f.name] = d.val();
}
}
$('#file_home_mainarea_new_file_table').empty();
$('#file_home_new_file_table').empty();
populated_file_obj = [];
var f = $('#file_home_mainarea_new_files').get(0);
var f = $('#file_home_new_files').get(0);
var f_no = 0;
for (var n = 0; n < f.files.length; n++)
{
@ -82,9 +82,9 @@ function populate_selected_files ()
var desc = file_desc[f.files[n].name];
if (desc == null) desc = '';
$('#file_home_mainarea_new_file_table').append (
$('#file_home_new_file_table').append (
codepot_sprintf (
'<tr id="file_home_mainarea_new_file_row_%d"><td><a href="#" id="file_home_mainarea_new_file_cancel_%d" onClick="cancel_out_new_file(%d); return false;"><i class="fa fa-trash"></i></a></td><td>%s</td><td><input type="text" id="file_home_mainarea_new_file_desc_%d" size="40" value="%s" /></td></tr>',
'<tr id="file_home_new_file_row_%d"><td><a href="#" id="file_home_new_file_cancel_%d" onClick="cancel_out_new_file(%d); return false;"><i class="fa fa-trash"></i></a></td><td>%s</td><td><input type="text" id="file_home_new_file_desc_%d" size="40" value="%s" /></td></tr>',
f_no, f_no, f_no, codepot_htmlspecialchars(f.files[n].name), f_no, codepot_addslashes(desc)
)
);
@ -99,7 +99,7 @@ function populate_selected_files ()
function cancel_out_new_file (no)
{
$('#file_home_mainarea_new_file_row_' + no).remove ();
$('#file_home_new_file_row_' + no).remove ();
populated_file_obj[no] = null;
}
@ -107,16 +107,16 @@ $(function () {
<?php if (isset($login['id']) && $login['id'] != ''): ?>
$('#file_home_mainarea_new_files').change (function () {
$('#file_home_new_files').change (function () {
populate_selected_files ();
});
$("#file_home_mainarea_new_description_tabs").tabs ();
$("#file_home_mainarea_new_description_tabs").bind ('tabsshow', function (event, ui) {
if (ui.index == 2) render_wiki ($("#file_home_mainarea_new_description").val());
$("#file_home_new_description_tabs").tabs ();
$("#file_home_new_description_tabs").bind ('tabsshow', function (event, ui) {
if (ui.index == 2) render_wiki ($("#file_home_new_description").val());
});
$('#file_home_mainarea_new_form_div').dialog (
$('#file_home_new_form_div').dialog (
{
title: '<?php print $this->lang->line('New');?>',
resizable: true,
@ -145,7 +145,7 @@ $(function () {
{
form_data.append ('file_new_file_' + f_no, f);
var d = $('#file_home_mainarea_new_file_desc_' + i);
var d = $('#file_home_new_file_desc_' + i);
if (d != null) form_data.append('file_new_file_desc_' + f_no, d.val());
f_no++;
@ -153,11 +153,11 @@ $(function () {
}
form_data.append ('file_new_file_count', f_no);
form_data.append ('file_new_tag', $('#file_home_mainarea_new_tag').val());
form_data.append ('file_new_name', $('#file_home_mainarea_new_name').val());
form_data.append ('file_new_description', $('#file_home_mainarea_new_description').val());
form_data.append ('file_new_tag', $('#file_home_new_tag').val());
form_data.append ('file_new_name', $('#file_home_new_name').val());
form_data.append ('file_new_description', $('#file_home_new_description').val());
$('#file_home_mainarea_new_form_div').dialog('disable');
$('#file_home_new_form_div').dialog('disable');
$.ajax({
url: codepot_merge_path('<?php print site_url() ?>', '<?php print "/file/xhr_import/{$project->id}"; ?>'),
type: 'POST',
@ -169,8 +169,8 @@ $(function () {
success: function (data, textStatus, jqXHR) {
import_in_progress = false;
$('#file_home_mainarea_new_form_div').dialog('enable');
$('#file_home_mainarea_new_form_div').dialog('close');
$('#file_home_new_form_div').dialog('enable');
$('#file_home_new_form_div').dialog('close');
if (data == 'ok')
{
// refresh the page to the head revision
@ -184,8 +184,8 @@ $(function () {
error: function (jqXHR, textStatus, errorThrown) {
import_in_progress = false;
$('#file_home_mainarea_new_form_div').dialog('enable');
$('#file_home_mainarea_new_form_div').dialog('close');
$('#file_home_new_form_div').dialog('enable');
$('#file_home_new_form_div').dialog('close');
var errmsg = '';
if (errmsg == '' && errorThrown != null) errmsg = errorThrown;
if (errmsg == '' && textStatus != null) errmsg = textStatus;
@ -201,7 +201,7 @@ $(function () {
},
'<?php print $this->lang->line('Cancel')?>': function () {
if (import_in_progress) return;
$('#file_home_mainarea_new_form_div').dialog('close');
$('#file_home_new_form_div').dialog('close');
}
},
@ -212,9 +212,9 @@ $(function () {
}
);
$("#file_home_mainarea_new_button").button().click (
$("#file_home_new_button").button().click (
function () {
$('#file_home_mainarea_new_form_div').dialog('open');
$('#file_home_new_form_div').dialog('open');
return false; // prevent the default behavior
}
);
@ -270,113 +270,86 @@ $this->load->view (
?>
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<a id="file_home_mainarea_new_button" href='#'><?php print $this->lang->line('New')?></a>
<a id="file_home_new_button" href='#'><?php print $this->lang->line('New')?></a>
<?php endif; ?>
</div>
<div style='clear: both'></div>
</div>
<div class="result" id="file_home_mainarea_result">
<?php
if (empty($files))
{
print htmlspecialchars($this->lang->line('FILE_MSG_NO_FILES_AVAILABLE'));
}
else
{
function comp_tag ($a, $b)
<div id="file_home_result" class="result">
<?php
if (empty($files))
{
//$x = explode ('.', $a);
//$y = explode ('.', $b);
$x = explode ('.', str_replace('-', '.', $a));
$y = explode ('.', str_replace('-', '.', $b));
$cx = count($x);
$cy = count($y);
$min = min($cx, $cy);
for ($i = 0; $i < $min; $i++)
{
if (is_numeric($x[$i]) && is_numeric($y[$i]))
{
$q = (int)$x[$i] - (int)$y[$i];
}
else
{
$q = strcmp($x[$i], $y[$i]);
}
if ($q != 0) return $q;
}
return ($cx > $cy)? -1:
($cx < $cy)? 1: 0;
print htmlspecialchars($this->lang->line('FILE_MSG_NO_FILES_AVAILABLE'));
}
function comp_files ($a, $b)
else
{
//$cmp = version_compare ($b->tag, $a->tag);
$cmp = comp_tag ($b->tag, $a->tag);
if ($cmp == 0)
function comp_tag ($a, $b)
{
$cmp = strcmp ($a->name, $b->name);
}
return $cmp;
}
//$x = explode ('.', $a);
//$y = explode ('.', $b);
$x = explode ('.', str_replace('-', '.', $a));
$y = explode ('.', str_replace('-', '.', $b));
$cx = count($x);
$cy = count($y);
$min = min($cx, $cy);
usort ($files, 'comp_files');
print '<table id="file_home_mainarea_result_table" class="fit-width-result-table">';
print '<tr class="heading">';
print '<th>' . $this->lang->line('Tag') . '</th>';
print '<th>' . $this->lang->line('Name') . '</th>';
print '<th>' . $this->lang->line('File') . '</th>';
print '<th>' . $this->lang->line('Summary') . '</th>';
print '<th>' . $this->lang->line('MD5') . '</th>';
print '</tr>';
$oldtag = '';
$rownum = 0;
$rowclasses = array ('odd', 'even');
foreach ($files as $file)
{
$hexname = $this->converter->AsciiToHex ($file->name);
$rowclass = $rowclasses[$rownum++ % 2];
$file_list_count = count($file->file_list);
if ($file_list_count <= 0)
{
print "<tr class='{$rowclass}'>";
print '<td>';
if ($file->tag != $oldtag)
for ($i = 0; $i < $min; $i++)
{
print htmlspecialchars($file->tag);
$oldtag = $file->tag;
if (is_numeric($x[$i]) && is_numeric($y[$i]))
{
$q = (int)$x[$i] - (int)$y[$i];
}
else
{
$q = strcmp($x[$i], $y[$i]);
}
if ($q != 0) return $q;
}
print '</td>';
print '<td>';
print anchor ("file/show/{$project->id}/{$hexname}", htmlspecialchars($file->name));
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
return ($cx > $cy)? -1:
($cx < $cy)? 1: 0;
}
else
function comp_files ($a, $b)
{
for ($i = 0; $i < $file_list_count; $i++)
//$cmp = version_compare ($b->tag, $a->tag);
$cmp = comp_tag ($b->tag, $a->tag);
if ($cmp == 0)
{
$cmp = strcmp ($a->name, $b->name);
}
return $cmp;
}
usort ($files, 'comp_files');
print '<table id="file_home_result_table" class="fit-width-result-table">';
print '<tr class="heading">';
print '<th>' . $this->lang->line('Tag') . '</th>';
print '<th>' . $this->lang->line('Name') . '</th>';
print '<th>' . $this->lang->line('File') . '</th>';
print '<th>' . $this->lang->line('Summary') . '</th>';
print '<th>' . $this->lang->line('MD5') . '</th>';
print '</tr>';
$oldtag = '';
$rownum = 0;
$rowclasses = array ('odd', 'even');
foreach ($files as $file)
{
$hexname = $this->converter->AsciiToHex ($file->name);
$rowclass = $rowclasses[$rownum++ % 2];
$file_list_count = count($file->file_list);
if ($file_list_count <= 0)
{
print "<tr class='{$rowclass}'>";
$f = $file->file_list[$i];
$xname = $this->converter->AsciiToHex ($f->filename);
print '<td>';
if ($i == 0 && $file->tag != $oldtag)
if ($file->tag != $oldtag)
{
print htmlspecialchars($file->tag);
$oldtag = $file->tag;
@ -384,59 +357,84 @@ else
print '</td>';
print '<td>';
if ($i == 0) print anchor ("file/show/{$project->id}/{$hexname}", htmlspecialchars($file->name));
print anchor ("file/show/{$project->id}/{$hexname}", htmlspecialchars($file->name));
print '</td>';
print '<td>';
print anchor ("file/get/{$project->id}/{$xname}", htmlspecialchars($f->filename));
print '</td>';
print '<td>';
print htmlspecialchars($f->description);
print '</td>';
print '<td><tt>';
print $f->md5sum;
print '</tt></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
}
}
}
print '</table>';
}
?>
else
{
for ($i = 0; $i < $file_list_count; $i++)
{
print "<tr class='{$rowclass}'>";
</div> <!-- file_home_mainarea_result -->
$f = $file->file_list[$i];
$xname = $this->converter->AsciiToHex ($f->filename);
print '<td>';
if ($i == 0 && $file->tag != $oldtag)
{
print htmlspecialchars($file->tag);
$oldtag = $file->tag;
}
print '</td>';
print '<td>';
if ($i == 0) print anchor ("file/show/{$project->id}/{$hexname}", htmlspecialchars($file->name));
print '</td>';
print '<td>';
print anchor ("file/get/{$project->id}/{$xname}", htmlspecialchars($f->filename));
print '</td>';
print '<td>';
print htmlspecialchars($f->description);
print '</td>';
print '<td><tt>';
print $f->md5sum;
print '</tt></td>';
print '</tr>';
}
}
}
print '</table>';
}
?>
</div> <!-- file_home_result -->
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<div id='file_home_new_form_div'>
<div style='line-height: 2em;'><?php print $this->lang->line('Tag'); ?>: <input type='text' id='file_home_new_tag' name='file_home_new_tag' /></div>
<div style='line-height: 2em;'><?php print $this->lang->line('Name'); ?>: <input type='text' id='file_home_new_name' name='file_home_new_name' size='50'/></div>
<div id='file_home_mainarea_new_form_div'>
<div style='line-height: 2em;'><?php print $this->lang->line('Tag'); ?>: <input type='text' id='file_home_mainarea_new_tag' name='file_home_new_tag' /></div>
<div style='line-height: 2em;'><?php print $this->lang->line('Name'); ?>: <input type='text' id='file_home_mainarea_new_name' name='file_home_new_name' size='50'/></div>
<div id='file_home_mainarea_new_description_tabs' style='width:100%;'>
<div id='file_home_new_description_tabs' style='width:100%;'>
<ul>
<li><a href='#file_home_mainarea_new_file_input'><?php print $this->lang->line('Files'); ?></a></li>
<li><a href='#file_home_mainarea_new_description_input'><?php print $this->lang->line('Description'); ?></a></li>
<li><a href='#file_home_mainarea_new_description_preview'><?php print $this->lang->line('Preview'); ?></a></li>
<li><a href='#file_home_new_file_input'><?php print $this->lang->line('Files'); ?></a></li>
<li><a href='#file_home_new_description_input'><?php print $this->lang->line('Description'); ?></a></li>
<li><a href='#file_home_new_description_preview'><?php print $this->lang->line('Preview'); ?></a></li>
</ul>
<div id='file_home_mainarea_new_file_input'>
<input type='file' id='file_home_mainarea_new_files' name='file_home_new_files' multiple='' autocomplete='off' style='color: transparent;' />
<table id='file_home_mainarea_new_file_table'></table>
<div id='file_home_new_file_input'>
<input type='file' id='file_home_new_files' name='file_home_new_files' multiple='' autocomplete='off' style='color: transparent;' />
<table id='file_home_new_file_table'></table>
</div>
<div id='file_home_mainarea_new_description_input'>
<textarea type='textarea' id='file_home_mainarea_new_description' name='file_home_new_description' rows=10 cols=80 style='width:100%;'></textarea>
<div id='file_home_new_description_input'>
<textarea type='textarea' id='file_home_new_description' name='file_home_new_description' rows=10 cols=80 style='width:100%;'></textarea>
</div>
<div id='file_home_mainarea_new_description_preview' class='form_input_preview'>
<div id='file_home_new_description_preview' class='form_input_preview'>
</div>
</div>
</div>
<?php endif; ?>
<div id='file_home_mainarea_alert'></div>
<div id='file_home_alert'></div>
</div> <!-- file_home_mainarea -->

View File

@ -34,7 +34,7 @@ $creole_file_base = site_url() . "/wiki/attachment0/{$project->id}/";
<script type="text/javascript">
function show_alert (outputMsg, titleMsg)
{
$('#file_show_mainarea_alert').html(outputMsg).dialog({
$('#file_show_alert').html(outputMsg).dialog({
title: titleMsg,
resizable: true,
modal: true,
@ -51,8 +51,8 @@ function show_alert (outputMsg, titleMsg)
function render_wiki()
{
creole_render_wiki (
"file_show_mainarea_wiki_text",
"file_show_mainarea_wiki",
"file_show_wiki_text",
"file_show_wiki",
"<?php print $creole_base; ?>",
"<?php print $creole_file_base; ?>/"
);
@ -64,7 +64,7 @@ function preview_edit_description (input_text)
{
creole_render_wiki_with_input_text (
input_text,
"file_show_mainarea_edit_description_preview",
"file_show_edit_description_preview",
"<?php print $creole_base; ?>",
"<?php print $creole_file_base; ?>/"
);
@ -83,15 +83,15 @@ function populate_selected_files_for_adding ()
var f = populated_file_obj_for_adding[n];
if (f != null)
{
var d = $('#file_show_mainarea_add_file_desc_' + n);
var d = $('#file_show_add_file_desc_' + n);
if (d != null) file_desc[f.name] = d.val();
}
}
$('#file_show_mainarea_add_file_table').empty();
$('#file_show_add_file_table').empty();
populated_file_obj_for_adding = [];
var f = $('#file_show_mainarea_add_files').get(0);
var f = $('#file_show_add_files').get(0);
var f_no = 0;
for (var n = 0; n < f.files.length; n++)
{
@ -100,9 +100,9 @@ function populate_selected_files_for_adding ()
var desc = file_desc[f.files[n].name];
if (desc == null) desc = '';
$('#file_show_mainarea_add_file_table').append (
$('#file_show_add_file_table').append (
codepot_sprintf (
'<tr id="file_show_mainarea_add_file_row_%d"><td><a href="#" id="file_show_mainarea_add_file_cancel_%d" onClick="cancel_out_add_file(%d); return false;"><i class="fa fa-trash"></i></a></td><td>%s</td><td><input type="text" id="file_show_mainarea_add_file_desc_%d" size="40" value="%s" /></td></tr>',
'<tr id="file_show_add_file_row_%d"><td><a href="#" id="file_show_add_file_cancel_%d" onClick="cancel_out_add_file(%d); return false;"><i class="fa fa-trash"></i></a></td><td>%s</td><td><input type="text" id="file_show_add_file_desc_%d" size="40" value="%s" /></td></tr>',
f_no, f_no, f_no, codepot_htmlspecialchars(f.files[n].name), f_no, codepot_addslashes(desc)
)
);
@ -118,14 +118,14 @@ function populate_selected_files_for_adding ()
function cancel_out_add_file (no)
{
$('#file_show_mainarea_add_file_row_' + no).remove ();
$('#file_show_add_file_row_' + no).remove ();
populated_file_obj_for_adding[no] = null;
}
function kill_edit_file (no)
{
var n = $('#file_show_mainarea_edit_file_name_' + no);
var d = $('#file_show_mainarea_edit_file_desc_' + no);
var n = $('#file_show_edit_file_name_' + no);
var d = $('#file_show_edit_file_desc_' + no);
if (n && d)
{
if (d.prop('disabled'))
@ -166,12 +166,12 @@ var original_file_desc = [
];
$(function () {
$('#file_show_mainarea_metadata').accordion({
$('#file_show_metadata').accordion({
collapsible: true,
heightStyle: "content"
});
$('#file_show_mainarea_files').accordion({
$('#file_show_files').accordion({
collapsible: true,
heightStyle: "content"
});
@ -179,12 +179,12 @@ $(function () {
<?php if (isset($login['id']) && $login['id'] != ''): ?>
$('#file_show_mainarea_edit_description_tabs').tabs ();
$('#file_show_mainarea_edit_description_tabs').bind ('tabsshow', function (event, ui) {
if (ui.index == 1) preview_edit_description ($('#file_show_mainarea_edit_description').val());
$('#file_show_edit_description_tabs').tabs ();
$('#file_show_edit_description_tabs').bind ('tabsshow', function (event, ui) {
if (ui.index == 1) preview_edit_description ($('#file_show_edit_description').val());
});
$('#file_show_mainarea_edit_form').dialog (
$('#file_show_edit_form').dialog (
{
title: '<?php print $this->lang->line('Edit');?>',
resizable: true,
@ -204,13 +204,13 @@ $(function () {
var form_data = new FormData();
var new_name = $('#file_show_mainarea_edit_name').val()
var new_name = $('#file_show_edit_name').val()
form_data.append ('file_edit_name', new_name);
form_data.append ('file_edit_tag', $('#file_show_mainarea_edit_tag').val());
form_data.append ('file_edit_description', $('#file_show_mainarea_edit_description').val());
form_data.append ('file_edit_tag', $('#file_show_edit_tag').val());
form_data.append ('file_edit_description', $('#file_show_edit_description').val());
$('#file_show_mainarea_edit_form').dialog('disable');
$('#file_show_edit_form').dialog('disable');
$.ajax({
url: codepot_merge_path('<?php print site_url() ?>', '<?php print "/file/xhr_update/{$project->id}/{$hexname}"; ?>'),
type: 'POST',
@ -222,8 +222,8 @@ $(function () {
success: function (data, textStatus, jqXHR) {
work_in_progress = false;
$('#file_show_mainarea_edit_form').dialog('enable');
$('#file_show_mainarea_edit_form').dialog('close');
$('#file_show_edit_form').dialog('enable');
$('#file_show_edit_form').dialog('close');
if (data == 'ok')
{
// refresh the page to the head revision
@ -237,8 +237,8 @@ $(function () {
error: function (jqXHR, textStatus, errorThrown) {
work_in_progress = false;
$('#file_show_mainarea_edit_form').dialog('enable');
$('#file_show_mainarea_edit_form').dialog('close');
$('#file_show_edit_form').dialog('enable');
$('#file_show_edit_form').dialog('close');
var errmsg = '';
if (errmsg == '' && errorThrown != null) errmsg = errorThrown;
if (errmsg == '' && textStatus != null) errmsg = textStatus;
@ -254,7 +254,7 @@ $(function () {
},
'<?php print $this->lang->line('Cancel')?>': function () {
if (work_in_progress) return;
$('#file_show_mainarea_edit_form').dialog('close');
$('#file_show_edit_form').dialog('close');
}
},
@ -266,7 +266,7 @@ $(function () {
);
$('#file_show_mainarea_delete_form').dialog (
$('#file_show_delete_form').dialog (
{
title: '<?php print $this->lang->line('Delete');?>',
resizable: true,
@ -285,10 +285,10 @@ $(function () {
var form_data = new FormData();
var f = $('#file_show_mainarea_delete_confirm');
var f = $('#file_show_delete_confirm');
if (f != null && f.is(':checked')) form_data.append ('file_delete_confirm', 'Y');
$('#file_show_mainarea_delete_form').dialog('disable');
$('#file_show_delete_form').dialog('disable');
$.ajax({
url: codepot_merge_path('<?php print site_url() ?>', '<?php print "/file/xhr_delete/{$project->id}/{$hexname}"; ?>'),
type: 'POST',
@ -300,8 +300,8 @@ $(function () {
success: function (data, textStatus, jqXHR) {
work_in_progress = false;
$('#file_show_mainarea_delete_form').dialog('enable');
$('#file_show_mainarea_delete_form').dialog('close');
$('#file_show_delete_form').dialog('enable');
$('#file_show_delete_form').dialog('close');
if (data == 'ok')
{
// refresh the page to the head revision
@ -315,8 +315,8 @@ $(function () {
error: function (jqXHR, textStatus, errorThrown) {
work_in_progress = false;
$('#file_show_mainarea_delete_form').dialog('enable');
$('#file_show_mainarea_delete_form').dialog('close');
$('#file_show_delete_form').dialog('enable');
$('#file_show_delete_form').dialog('close');
show_alert ('Failed - ' + errorThrown, "<?php print $this->lang->line('Error')?>");
}
});
@ -328,7 +328,7 @@ $(function () {
},
'<?php print $this->lang->line('Cancel')?>': function () {
if (work_in_progress) return;
$('#file_show_mainarea_delete_form').dialog('close');
$('#file_show_delete_form').dialog('close');
}
},
@ -340,11 +340,11 @@ $(function () {
}
);
$('#file_show_mainarea_add_files').change (function () {
$('#file_show_add_files').change (function () {
populate_selected_files_for_adding ();
});
$('#file_show_mainarea_add_file_form').dialog (
$('#file_show_add_file_form').dialog (
{
title: '<?php print $this->lang->line('Add');?>',
resizable: true,
@ -371,14 +371,14 @@ $(function () {
{
form_data.append ('file_add_file_' + f_no, f);
var d = $('#file_show_mainarea_add_file_desc_' + i);
var d = $('#file_show_add_file_desc_' + i);
if (d != null) form_data.append('file_add_file_desc_' + f_no, d.val());
f_no++;
}
}
form_data.append ('file_add_file_count', f_no);
$('#file_show_mainarea_add_file_form').dialog('disable');
$('#file_show_add_file_form').dialog('disable');
$.ajax({
url: codepot_merge_path('<?php print site_url() ?>', '<?php print "/file/xhr_add_file/{$project->id}/{$hexname}"; ?>'),
type: 'POST',
@ -390,8 +390,8 @@ $(function () {
success: function (data, textStatus, jqXHR) {
work_in_progress = false;
$('#file_show_mainarea_add_file_form').dialog('enable');
$('#file_show_mainarea_add_file_form').dialog('close');
$('#file_show_add_file_form').dialog('enable');
$('#file_show_add_file_form').dialog('close');
if (data == 'ok')
{
// refresh the page to the head revision
@ -405,8 +405,8 @@ $(function () {
error: function (jqXHR, textStatus, errorThrown) {
work_in_progress = false;
$('#file_show_mainarea_add_file_form').dialog('enable');
$('#file_show_mainarea_add_file_form').dialog('close');
$('#file_show_add_file_form').dialog('enable');
$('#file_show_add_file_form').dialog('close');
show_alert ('Failed - ' + errorThrown, "<?php print $this->lang->line('Error')?>");
}
});
@ -418,7 +418,7 @@ $(function () {
},
'<?php print $this->lang->line('Cancel')?>': function () {
if (work_in_progress) return;
$('#file_show_mainarea_add_file_form').dialog('close');
$('#file_show_add_file_form').dialog('close');
}
},
@ -430,7 +430,7 @@ $(function () {
}
);
$('#file_show_mainarea_edit_file_form').dialog (
$('#file_show_edit_file_form').dialog (
{
title: '<?php print $this->lang->line('Edit');?>',
resizable: true,
@ -452,8 +452,8 @@ $(function () {
var f_no = 0;
for (var i = 0; i <= <?php print $file_count; ?>; i++)
{
var n = $('#file_show_mainarea_edit_file_name_' + i);
var d = $('#file_show_mainarea_edit_file_desc_' + i);
var n = $('#file_show_edit_file_name_' + i);
var d = $('#file_show_edit_file_desc_' + i);
if (n && d)
{
@ -473,7 +473,7 @@ $(function () {
}
form_data.append ('file_edit_file_count', f_no);
$('#file_show_mainarea_edit_file_form').dialog('disable');
$('#file_show_edit_file_form').dialog('disable');
$.ajax({
url: codepot_merge_path('<?php print site_url() ?>', '<?php print "/file/xhr_edit_file/{$project->id}/{$hexname}"; ?>'),
type: 'POST',
@ -485,8 +485,8 @@ $(function () {
success: function (data, textStatus, jqXHR) {
work_in_progress = false;
$('#file_show_mainarea_edit_file_form').dialog('enable');
$('#file_show_mainarea_edit_file_form').dialog('close');
$('#file_show_edit_file_form').dialog('enable');
$('#file_show_edit_file_form').dialog('close');
if (data == 'ok')
{
// refresh the page to the head revision
@ -500,8 +500,8 @@ $(function () {
error: function (jqXHR, textStatus, errorThrown) {
work_in_progress = false;
$('#file_show_mainarea_edit_file_form').dialog('enable');
$('#file_show_mainarea_edit_file_form').dialog('close');
$('#file_show_edit_file_form').dialog('enable');
$('#file_show_edit_file_form').dialog('close');
show_alert ('Failed - ' + errorThrown, "<?php print $this->lang->line('Error')?>");
}
});
@ -513,7 +513,7 @@ $(function () {
},
'<?php print $this->lang->line('Cancel')?>': function () {
if (work_in_progress) return;
$('#file_show_mainarea_edit_file_form').dialog('close');
$('#file_show_edit_file_form').dialog('close');
}
},
@ -525,29 +525,29 @@ $(function () {
}
);
$('#file_show_mainarea_edit_button').button().click (
$('#file_show_edit_button').button().click (
function () {
$('#file_show_mainarea_edit_form').dialog('open');
$('#file_show_edit_form').dialog('open');
return false; // prevent the default behavior
}
);
$('#file_show_mainarea_delete_button').button().click (
$('#file_show_delete_button').button().click (
function() {
$('#file_show_mainarea_delete_form').dialog('open');
$('#file_show_delete_form').dialog('open');
return false;
}
);
$('#file_show_mainarea_add_file_button').button().click (
$('#file_show_add_file_button').button().click (
function() {
$('#file_show_mainarea_add_file_form').dialog('open');
$('#file_show_add_file_form').dialog('open');
return false;
}
);
$('#file_show_mainarea_edit_file_button').button().click (
$('#file_show_edit_file_button').button().click (
function() {
$('#file_show_mainarea_edit_file_form').dialog('open');
$('#file_show_edit_file_form').dialog('open');
return false;
}
);
@ -601,21 +601,18 @@ $this->load->view (
<div class="actions">
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<a id="file_show_mainarea_edit_button" href='#'><?php print $this->lang->line('Edit')?></a>
<a id="file_show_mainarea_delete_button" href='#'><?php print $this->lang->line('Delete')?></a>
<a id="file_show_edit_button" href='#'><?php print $this->lang->line('Edit')?></a>
<a id="file_show_delete_button" href='#'><?php print $this->lang->line('Delete')?></a>
<?php endif; ?>
</div>
<div style='clear: both'></div>
</div>
<div id='file_show_mainarea_result'>
<div id='file_show_mainarea_metadata' class='collapsible-box'>
<div id='file_show_mainarea_metadata_header' class='collapsible-box-header'><?php print $this->lang->line('Metadata')?></div>
<div id='file_show_mainarea_metadata_body'>
<ul>
<div id='file_show_metadata' class='collapsible-box'>
<div id='file_show_metadata_header' class='collapsible-box-header'><?php print $this->lang->line('Metadata')?></div>
<div id='file_show_metadata_body'>
<ul id='file_show_metadata_list'>
<li><?php print $this->lang->line('Created on')?> <?php print codepot_dbdatetodispdate($file->createdon); ?></li>
<li><?php print $this->lang->line('Created by')?> <?php print htmlspecialchars($file->createdby); ?></li>
<li><?php print $this->lang->line('Last updated on')?> <?php print codepot_dbdatetodispdate($file->updatedon); ?></li>
@ -624,18 +621,18 @@ $this->load->view (
</div>
</div>
<div id='file_show_mainarea_files' class='collapsible-box'>
<div id='file_show_mainarea_files_header' class='collapsible-box-header'><?php print $this->lang->line('Files')?></div>
<div id='file_show_files' class='collapsible-box'>
<div id='file_show_files_header' class='collapsible-box-header'><?php print $this->lang->line('Files')?></div>
<div id='file_show_mainarea_files_body'>
<div id='file_show_files_body'>
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<div>
<a id="file_show_mainarea_add_file_button" href='#'><?php print $this->lang->line('Add')?></a>
<a id="file_show_mainarea_edit_file_button" href='#'><?php print $this->lang->line('Edit')?></a>
<a id="file_show_add_file_button" href='#'><?php print $this->lang->line('Add')?></a>
<a id="file_show_edit_file_button" href='#'><?php print $this->lang->line('Edit')?></a>
</div>
<?php endif; ?>
<table id='file_show_mainarea_files_table'>
<table id='file_show_files_table'>
<?php
for ($i = 0; $i < $file_count; $i++)
{
@ -658,50 +655,47 @@ $this->load->view (
</div>
</div>
<div class="result" id="file_show_mainarea_wiki">
<pre id="file_show_mainarea_wiki_text" style="visibility: hidden">
<?php print htmlspecialchars($file->description); ?>
</pre>
</div> <!-- file_show_mainarea_wiki -->
</div> <!-- file_show_mainarea_result -->
<div id="file_show_result'" class="result">
<div id="file_show_wiki">
<pre id="file_show_wiki_text" style="visibility: hidden"><?php print htmlspecialchars($file->description); ?></pre>
</div>
</div>
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<div id='file_show_mainarea_edit_form'>
<div id='file_show_edit_form'>
<div style='line-height: 2em;'>
<?php print $this->lang->line('Tag'); ?>: <input type='text' id='file_show_mainarea_edit_tag' name='file_show_edit_tag' size='30' value='<?php print addslashes($file->tag); ?>'/>
<?php print $this->lang->line('Name'); ?>: <input type='text' id='file_show_mainarea_edit_name' name='file_show_edit_name' size='60' value='<?php print addslashes($file->name); ?>'/>
<?php print $this->lang->line('Tag'); ?>: <input type='text' id='file_show_edit_tag' name='file_show_edit_tag' size='30' value='<?php print addslashes($file->tag); ?>'/>
<?php print $this->lang->line('Name'); ?>: <input type='text' id='file_show_edit_name' name='file_show_edit_name' size='60' value='<?php print addslashes($file->name); ?>'/>
</div>
<div id='file_show_mainarea_edit_description_tabs' style='width:100%;'>
<div id='file_show_edit_description_tabs' style='width:100%;'>
<ul>
<li><a href='#file_show_mainarea_edit_description_input'><?php print $this->lang->line('Description'); ?></a></li>
<li><a href='#file_show_mainarea_edit_description_preview'><?php print $this->lang->line('Preview'); ?></a></li>
<li><a href='#file_show_edit_description_input'><?php print $this->lang->line('Description'); ?></a></li>
<li><a href='#file_show_edit_description_preview'><?php print $this->lang->line('Preview'); ?></a></li>
</ul>
<div id='file_show_mainarea_edit_description_input'>
<textarea type='textarea' id='file_show_mainarea_edit_description' name='file_show_edit_description' rows=24 cols=100 style='width:100%;'><?php print htmlspecialchars($file->description); ?></textarea>
<div id='file_show_edit_description_input'>
<textarea type='textarea' id='file_show_edit_description' name='file_show_edit_description' rows=24 cols=100 style='width:100%;'><?php print htmlspecialchars($file->description); ?></textarea>
</div>
<div id='file_show_mainarea_edit_description_preview' class='form_input_preview'>
<div id='file_show_edit_description_preview' class='form_input_preview'>
</div>
</div>
</div>
<div id='file_show_mainarea_delete_form'>
<input type='checkbox' id='file_show_mainarea_delete_confirm' />
<div id='file_show_delete_form'>
<input type='checkbox' id='file_show_delete_confirm' />
<?php print $this->lang->line('MSG_SURE_TO_DELETE_THIS') . ' - ' . htmlspecialchars($file->name); ?>
</div>
<div id='file_show_mainarea_add_file_form'>
<div id='file_show_mainarea_add_file_input'>
<input type='file' id='file_show_mainarea_add_files' name='file_show_add_files' multiple='' autocomplete='off' style='color: transparent;' />
<table id='file_show_mainarea_add_file_table'></table>
<div id='file_show_add_file_form'>
<div id='file_show_add_file_input'>
<input type='file' id='file_show_add_files' name='file_show_add_files' multiple='' autocomplete='off' style='color: transparent;' />
<table id='file_show_add_file_table'></table>
</div>
</div>
<div id='file_show_mainarea_edit_file_form'>
<div id='file_show_edit_file_form'>
<table>
<?php
for ($i = 0; $i < $file_count; $i++)
@ -710,9 +704,9 @@ $this->load->view (
print '<tr><td>';
printf ('<a href="#" onClick="kill_edit_file(%d); return false;"><i class="fa fa-trash"></i></a>', $i);
print '</td><td>';
printf ('<span id="file_show_mainarea_edit_file_name_%d">%s</span>', $i, htmlspecialchars($f->filename));
printf ('<span id="file_show_edit_file_name_%d">%s</span>', $i, htmlspecialchars($f->filename));
print '</td><td>';
printf ('<input type="text" id="file_show_mainarea_edit_file_desc_%d" value="%s" size="40" autocomplete="off" />', $i, addslashes($f->description));
printf ('<input type="text" id="file_show_edit_file_desc_%d" value="%s" size="40" autocomplete="off" />', $i, addslashes($f->description));
print '</td></tr>';
}
?>
@ -721,7 +715,7 @@ $this->load->view (
<?php endif; ?>
<div id='file_show_mainarea_alert'></div>
<div id='file_show_alert'></div>
</div> <!-- file_show_mainarea -->

View File

@ -322,7 +322,7 @@ $this->load->view (
<div style='clear: both;'></div>
</div>
<div class="result" id="issue_home_result">
<div id="issue_home_result" class="result">
<?php
if (empty($issues))
{

View File

@ -713,7 +713,6 @@ $this->load->view (
<div class="mainarea" id="issue_show_mainarea">
<div class="title-band" id="issue_show_title_band">
<div class="title">
<?php print $this->lang->line('Issue')?> <?php print htmlspecialchars($issue->id)?>:
@ -781,48 +780,45 @@ $this->load->view (
</div>
</div>
<div id="issue_show_result" class="result">
<div id="issue_show_description">
<pre id="issue_show_description_pre" style="visibility: hidden">
<?php print htmlspecialchars($issue->description); ?>
</pre>
</div> <!-- issue_show_description -->
<div id="issue_show_description">
<pre id="issue_show_description_pre" style="visibility: hidden"><?php print htmlspecialchars($issue->description); ?></pre>
</div> <!-- issue_show_description -->
<div id="issue_show_files">
<div id="issue_show_files">
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<i class='fa fa-plug'></i> <?php print $this->lang->line('Attachments'); ?>
<a id="issue_show_add_file_button" href='#'><?php print $this->lang->line('Add')?></a>
<a id="issue_show_edit_file_button" href='#'><?php print $this->lang->line('Edit')?></a>
<?php elseif (!empty($issue->files)): ?>
<i class='fa fa-plug'></i> <?php print $this->lang->line('Attachments'); ?>
<?php endif; ?>
<?php if (!empty($issue->files)): ?>
<ul>
<?php
for ($i = 0; $i < $issue_file_count; $i++)
{
$f = $issue->files[$i];
$hexname = $this->converter->AsciiToHex ($f->filename);
print '<li>';
print anchor (
"issue/file/{$project->id}/{$issue->id}/{$hexname}",
htmlspecialchars($f->filename)
);
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<i class='fa fa-plug'></i> <?php print $this->lang->line('Attachments'); ?>
<a id="issue_show_add_file_button" href='#'><?php print $this->lang->line('Add')?></a>
<a id="issue_show_edit_file_button" href='#'><?php print $this->lang->line('Edit')?></a>
<?php elseif (!empty($issue->files)): ?>
<i class='fa fa-plug'></i> <?php print $this->lang->line('Attachments'); ?>
<?php endif; ?>
<?php if (!empty($issue->files)): ?>
<ul>
<?php
for ($i = 0; $i < $issue_file_count; $i++)
{
$f = $issue->files[$i];
$hexname = $this->converter->AsciiToHex ($f->filename);
print '<li>';
print anchor (
"issue/file/{$project->id}/{$issue->id}/{$hexname}",
htmlspecialchars($f->filename)
);
if (!empty($f->description)) printf (' - %s', htmlspecialchars($f->description));
print '</li>';
}
?>
</ul>
<?php endif; ?>
if (!empty($f->description)) printf (' - %s', htmlspecialchars($f->description));
print '</li>';
}
?>
</ul>
<?php endif; ?>
</div>
</div>
<div id="issue_show_changes">
<?php
<?php
$commentno = 0;
$msgfmt_changed_from_to = $this->lang->line ('ISSUE_MSG_CHANGED_X_FROM_Y_TO_Z');
@ -949,10 +945,8 @@ $this->load->view (
print '</tr>';
print '</table>';
?>
</div>
?>
</div> <!-- issue_show_changes -->
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<div id='issue_show_edit_form'>

View File

@ -315,14 +315,15 @@ foreach ($urls as $url)
<?php print htmlspecialchars($project->name)?>
</div>
<div class="result" id="project_home_mainarea_wiki">
<pre id="project_home_mainarea_wiki_text" style="visibility: hidden">
<?php print htmlspecialchars($project->description); ?>
</pre>
</div> <!-- project_home_mainarea_wiki -->
<div id="project_home_result" class="result">
<div id="project_home_mainarea_wiki">
<pre id="project_home_mainarea_wiki_text" style="visibility: hidden"><?php print htmlspecialchars($project->description); ?></pre>
</div> <!-- project_home_mainarea_wiki -->
</div>
</div> <!-- project_home_mainarea -->
<div class='footer-pusher'></div> <!-- for sticky footer -->
</div> <!-- project_home_content -->

View File

@ -28,8 +28,8 @@
function render_wiki()
{
creole_render_wiki (
"site_home_mainarea_result_wiki_text",
"site_home_mainarea_result_wiki",
"site_home_result_wiki_text",
"site_home_result_wiki",
"<?php print site_url()?>/site/wiki/",
"<?php print site_url()?>/site/image/"
);
@ -41,13 +41,13 @@ $(function () {
render_wiki ();
<?php if ($issues && count($issues) > 0): ?>
$("#site_home_mainarea_result_open_issues").accordion ({
$("#site_home_result_open_issues").accordion ({
collapsible: true
});
<?php endif; ?>
<?php if ($recently_resolved_issues && count($recently_resolved_issues) > 0): ?>
$("#site_home_mainarea_result_resolved_issues").accordion ({
$("#site_home_result_resolved_issues").accordion ({
collapsible: true
});
<?php endif; ?>
@ -282,14 +282,14 @@ foreach ($latest_projects as $project)
<div class="mainarea" id="site_home_mainarea">
<div class="result" id="site_home_mainarea_result">
<div id="site_home_result" class="result">
<?php if ($issues && count($issues) > 0): ?>
<div id="site_home_mainarea_result_open_issues" class="collapsible-box">
<div id="site_home_mainarea_result_open_issues_header" class="collapsible-box-header">
<?php if ($issues && count($issues) > 0): ?>
<div id="site_home_result_open_issues" class="collapsible-box">
<div id="site_home_result_open_issues_header" class="collapsible-box-header">
<?php print $this->lang->line('Open issues')?>
</div>
<ul id="site_home_mainarea_result_open_issues_list" class="collapsible-box-list">
<ul id="site_home_result_open_issues_list" class="collapsible-box-list">
<?php
foreach ($issues as $issue)
{
@ -313,14 +313,14 @@ foreach ($latest_projects as $project)
?>
</ul>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($recently_resolved_issues && count($recently_resolved_issues) > 0): ?>
<div id="site_home_mainarea_result_resolved_issues" class="collapsible-box">
<div id="site_home_mainarea_result_resolved_issues_header" class="collapsible-box-header">
<?php if ($recently_resolved_issues && count($recently_resolved_issues) > 0): ?>
<div id="site_home_result_resolved_issues" class="collapsible-box">
<div id="site_home_result_resolved_issues_header" class="collapsible-box-header">
<?php print $this->lang->line('Recently resolved issues')?>
</div>
<ul id="site_home_mainarea_result_resolved_issues_list" class="collapsible-box-list">
<ul id="site_home_result_resolved_issues_list" class="collapsible-box-list">
<?php
foreach ($recently_resolved_issues as $issue)
{
@ -344,17 +344,14 @@ foreach ($latest_projects as $project)
?>
</ul>
</div>
<?php endif; ?>
<?php endif; ?>
<div id="site_home_result_wiki">
<pre id="site_home_result_wiki_text" style="visibility: hidden"><?php print htmlspecialchars($site->text); ?></pre>
</div> <!-- site_home_text -->
<div id="site_home_mainarea_result_wiki">
<pre id="site_home_mainarea_result_wiki_text" style="visibility: hidden">
<?php print htmlspecialchars($site->text); ?>
</pre>
</div> <!-- site_home_mainarea_text -->
</div> <! -- site_home_result -->
</div> <! -- site_home_mainarea_result -->
<!-- ////////////////////////////////////////////////////////////////////// -->
</div> <!-- site_home_mainarea -->

View File

@ -31,6 +31,7 @@
<?php
$hex_wikiname = $this->converter->AsciiToHex ($wiki->name);
$file_count = count($wiki->attachments);
?>
<script type="text/javascript">
@ -51,11 +52,12 @@ function show_alert (outputMsg, titleMsg)
});
}
function resize_editor()
{
var titleband = $("#wiki_edit_title_band");
var editor = $("#wiki_edit_text_editor");
var attachment = $("#wiki_edit_attachment");
var files = $("#wiki_edit_files");
var footer = $("#codepot_footer");
editor.height(0); // to prevent from continuous growing. it seems to affect footer placement when not set to 0.
@ -63,7 +65,7 @@ function resize_editor()
var ioff = titleband.offset();
var foff = footer.offset();
ioff.top += titleband.outerHeight() + 5 + attachment.outerHeight() + 10;
ioff.top += titleband.outerHeight() + 5 + files.outerHeight() + 10;
editor.offset (ioff);
//editor.innerHeight (foff.top - ioff.top - 5);
@ -71,11 +73,128 @@ function resize_editor()
editor.innerWidth (titleband.innerWidth());
}
var new_attachment_no = 0;
var populated_file_obj_for_adding = [];
var populated_file_max_for_adding = 0;
var original_file_name_array = [
<?php
for ($i = 0; $i < $file_count; $i++)
{
$f = $wiki->attachments[$i];
printf ("%s\t'%s'", (($i == 0)? '': ",\n"), addslashes($f->name));
}
print "\n";
?>
];
function populate_selected_files_for_adding ()
{
$('#wiki_edit_add_file_list').empty();
populated_file_obj_for_adding = [];
var f = $('#wiki_edit_add_files').get(0);
var f_no = 0;
for (var n = 0; n < f.files.length; n++)
{
if (f.files[n] != null)
{
$('#wiki_edit_add_file_list').append (
codepot_sprintf (
'<li id="wiki_edit_add_file_row_%d"><a href="#" id="wiki_edit_add_file_cancel_%d" onClick="cancel_out_add_file(%d); return false;"><i class="fa fa-trash"></i></a> %s</li>',
f_no, f_no, f_no, codepot_htmlspecialchars(f.files[n].name)
)
);
populated_file_obj_for_adding[f_no] = f.files[n];
f_no++;
}
}
populated_file_max_for_adding = f_no;
}
function cancel_out_add_file (no)
{
$('#wiki_edit_add_file_row_' + no).remove ();
populated_file_obj_for_adding[no] = null;
}
function kill_file (no)
{
var n = $('#wiki_edit_file_name_' + no);
if (n)
{
if (n.prop('disabled'))
{
n.css ('text-decoration', '');
n.prop ('disabled', false);
}
else
{
n.css ('text-decoration', 'line-through');
n.prop ('disabled', true);
}
}
resize_editor ();
}
function update_original_file_name_array ()
{
$('#wiki_edit_add_file_list').empty();
for (var i = 0; i < populated_file_max_for_adding; i++)
{
var f = populated_file_obj_for_adding[i];
if (f != null) original_file_name_array.push (f.name);
}
populated_file_obj_for_adding = [];
populated_file_max_for_adding = 0;
$('#wiki_edit_add_files').empty();
var f_no = 0;
var file_name_array = [];
for (var i = 0; i < original_file_name_array.length; i++)
{
var n = $('#wiki_edit_file_name_' + i);
if (n)
{
if (n.prop('disabled'))
{
// skip
}
else
{
file_name_array.push (original_file_name_array[i]);
}
}
}
$('#wiki_edit_file_list').empty();
original_file_name_array = file_name_array;
for (var i = 0; i < original_file_name_array.length; i++)
{
$('#wiki_edit_file_list').append (
codepot_sprintf (
'<li><a href="#" onClick="kill_file(%d); return false;"><i class="fa fa-trash"></i></a><span id="wiki_edit_file_name_%d">%s</span></li>',
i, i, original_file_name_array[i]
)
);
}
}
var wiki_text_editor = null;
var work_in_progress = false;
var wiki_original_name = '<?php print addslashes($wiki->name); ?>';
var wiki_new_name = '';
<?php if (function_exists('json_encode')): ?>
var wiki_original_text = <?php print json_encode($wiki->text); ?>;
<?php else: ?>
var wiki_original_text = '<?php print addcslashes($wiki->text, "\0..\37'\"\\"); ?>';
<?php endif; ?>
function show_in_progress_message (outputMsg, titleMsg)
{
@ -101,23 +220,25 @@ function show_in_progress_message (outputMsg, titleMsg)
}
$(function () {
$('#wiki_edit_more_new_attachment').button().click (
function () {
var html = [
'<li><input type="file" name="wiki_new_attachment_',
++new_attachment_no,
'" /></li>'
].join("");
$('#wiki_edit_new_attachment_list').append (html);
resize_editor();
return false;
}
);
$('#wiki_edit_files').accordion({
collapsible: true,
heightStyle: "content",
activate: function() { resize_editor(); }
});
$('#wiki_edit_add_files_button').button().click (function () {
$('#wiki_edit_add_files').trigger('click');
return false;
});
$('#wiki_edit_add_files').change (function () {
populate_selected_files_for_adding ();
});
wiki_text_editor = new MediumEditor('#wiki_edit_text_editor', {
autoLink: true,
imageDragging: true,
buttonLabels: 'fontawesome',
anchorPreview: false,
toolbar: {
allowMultiParagraphSelection: true,
@ -155,7 +276,7 @@ $(function () {
});
<?php if ($mode == 'update'): ?>
wiki_text_editor.setContent ('<?php print addslashes($wiki->text); ?>', 0);
wiki_text_editor.setContent (wiki_original_text, 0);
<?php endif; ?>
$("#wiki_edit_save_button").button().click (function() {
@ -173,26 +294,34 @@ $(function () {
var form_data = new FormData();
/*
var f_no = 0;
for (var i = 0; i <= populated_file_max; i++)
for (var i = 0; i < populated_file_max_for_adding; i++)
{
var f = populated_file_obj[i];
var f = populated_file_obj_for_adding[i];
if (f != null)
{
form_data.append ('wiki_file_' + f_no, f);
var d = $('#wiki_edit_file_desc_' + i);
if (d != null) form_data.append('wiki_file_desc_' + f_no, d.val());
f_no++;
}
}
form_data.append ('wiki_file_count', f_no);
form_data.append ('wiki_file_count', f_no);*/
f_no = 0;
for (var i = 0; i < original_file_name_array.length; i++)
{
var n = $('#wiki_edit_file_name_' + i);
if (n)
{
if (n.prop('disabled'))
{
form_data.append ('wiki_kill_file_name_' + f_no, original_file_name_array[i]);
f_no++;
}
}
}
form_data.append ('wiki_kill_file_count', f_no);
form_data.append ('wiki_type', 'H');
form_data.append ('wiki_doctype', 'H');
form_data.append ('wiki_name', wiki_new_name);
form_data.append ('wiki_original_name', wiki_original_name);
form_data.append ('wiki_text', e.wiki_edit_text_editor.value);
@ -208,14 +337,23 @@ $(function () {
success: function (data, textStatus, jqXHR) {
work_in_progress = false;
show_in_progress_message (null, null);
if (data == 'ok')
{
var name_changed = (wiki_original_name != wiki_new_name);
wiki_original_name = wiki_new_name;
// TODO: reload contents?
wiki_original_text = e.wiki_edit_text_editor.value;
update_original_file_name_array ();
show_in_progress_message (null, null);
if (name_changed)
{
// reload the whole page if the name has changed.
$(location).attr ('href', codepot_merge_path('<?php print site_url(); ?>', '<?php print "/wiki/updatex/{$project->id}/"; ?>' + codepot_string_to_hex(wiki_new_name)));
}
}
else
{
show_in_progress_message (null, null);
show_alert ('<pre>' + codepot_htmlspecialchars(data) + '</pre>', "<?php print $this->lang->line('Error')?>");
}
},
@ -247,6 +385,15 @@ $(function () {
return false;
});
$(window).on ("beforeunload", function (e) {
var ed = wiki_text_editor.serialize();
if (wiki_original_text != ed.wiki_edit_text_editor.value)
{
return 'Do you want to discard changes?';
}
// return null; // this line caused firefox to show the default message.
});
$(window).resize(resize_editor);
resize_editor ();
});
@ -297,44 +444,35 @@ $this->load->view (
<div style='clear: both'></div>
</div>
<div id='wiki_edit_attachment'>
<?php if (!empty($wiki->attachments)): ?>
<?php print form_label($this->lang->line('WIKI_ATTACHMENTS').': ', 'wiki_edit_attachment_list')?>
<div id='wiki_edit_files' class='collapsible-box'>
<div id='wiki_edit_files_header' class='collapsible-box-header'>
<?php print $this->lang->line('WIKI_ATTACHMENTS')?>
<a href='#' id='wiki_edit_add_files_button'><?php print $this->lang->line('New')?></a>
</div>
<div id='wiki_edit_files_body'>
<input type='file' id='wiki_edit_add_files' name='wiki_add_files' multiple='' autocomplete='off' style='color: transparent; visibility: hidden; display: none;' />
<ul id='wiki_edit_attachment_list'>
<?php
foreach ($wiki->attachments as $att)
{
$hexattname =
$this->converter->AsciiToHex($att->name) .
'@' .
$this->converter->AsciiToHex($att->encname);
$escattname = htmlspecialchars($att->name);
<ul id='wiki_edit_file_list'>
<?php if (!empty($wiki->attachments)): ?>
<?php
for ($i = 0; $i < $file_count; $i++)
{
$att = $wiki->attachments[$i];;
print '<li>';
printf ('<a href="#" onClick="kill_file(%d); return false;"><i class="fa fa-trash"></i></a>', $i);
printf (' <span id="wiki_edit_file_name_%d">%s</span>', $i, htmlspecialchars($att->name));
print '</li>';
}
?>
<?php endif; ?>
</ul>
print '<li>';
print "<input type='checkbox' name='wiki_delete_attachment[]' value='{$hexattname}' title='Check to delete {$escattname}'/>";
print $escattname;
print '</li>';
}
?>
</ul>
<?php endif; ?>
<?php print form_label($this->lang->line('WIKI_NEW_ATTACHMENTS').': ', 'wiki_edit_new_attachment_list')?>
<a href='#' id='wiki_edit_more_new_attachment'>
<?php print $this->lang->line('WIKI_MORE_NEW_ATTACHMENTS')?>
</a>
<ul id='wiki_edit_new_attachment_list'>
<li>
<input type='file' name='wiki_new_attachment_0' />
<!--<input type='checkbox' name='wiki_delete_attachment[]' value='delete'/>Delete-->
</li>
</ul>
<ul id='wiki_edit_add_file_list'>
</ul>
</div>
</div>
<div id="wiki_edit_result">
<div id="wiki_edit_result" class="result">
<div id='wiki_edit_text_editor'></div>
</div> <!-- wiki_edit_result -->

View File

@ -37,12 +37,18 @@ function show_alert (outputMsg, titleMsg)
$(function () {
<?php if (isset($login['id']) && $login['id'] != ''): ?>
$("#wiki_home_new_button").button().click (
$("#wiki_home_new_h_button").button().click (
function () {
$(location).attr ('href', codepot_merge_path('<?php print site_url(); ?>', '<?php print "/wiki/createx/{$project->id}"; ?>'));
return false;
}
);
$("#wiki_home_new_c_button").button().click (
function () {
$(location).attr ('href', codepot_merge_path('<?php print site_url(); ?>', '<?php print "/wiki/create/{$project->id}"; ?>'));
return false;
}
);
<?php endif; ?>
});
@ -74,9 +80,7 @@ $this->load->view (
'project' => $project,
),
'ctxmenuitems' => array (
array ("wiki/create/{$project->id}", '<i class="fa fa-plus"></i> ' . $this->lang->line('New'))
)
'ctxmenuitems' => array ()
)
);
?>
@ -91,7 +95,8 @@ $this->load->view (
<div class="actions">
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<a id="wiki_home_new_button" href='#'><?php print $this->lang->line('New')?></a>
<a id="wiki_home_new_h_button" href='#'><?php print $this->lang->line('New')?> [H]</a>
<a id="wiki_home_new_c_button" href='#'><?php print $this->lang->line('New')?> [C]</a>
<?php endif; ?>
<!-- <a id="wiki_home_search_button" href='#'><?php print $this->lang->line('Search')?></a> -->
</div>
@ -99,7 +104,7 @@ $this->load->view (
<div style='clear: both'></div>
</div>
<div id="wiki_home_mainarea_result" class="result">
<div id="wiki_home_result" class="result">
<?php
if (empty($wikis))
{

View File

@ -29,7 +29,7 @@
<?php
$hex_wikiname = $this->converter->AsciiToHex ($wiki->name);
if ($wiki->type == 'H')
if ($wiki->doctype == 'H')
{
$is_html = TRUE;
$update_command = 'updatex';
@ -167,12 +167,6 @@ $(function () {
}
);
$("#wiki_show_new_button").button().click (
function () {
$(location).attr ('href', codepot_merge_path('<?php print site_url(); ?>', '<?php print "/wiki/createx/{$project->id}"; ?>'));
return false;
}
);
$("#wiki_show_edit_button").button().click (
function () {
$(location).attr ('href', codepot_merge_path('<?php print site_url(); ?>', '<?php print "/wiki/{$update_command}/{$project->id}/{$hex_wikiname}"; ?>'));
@ -219,9 +213,7 @@ $this->load->view (
'project' => $project,
),
'ctxmenuitems' => array (
array ("wiki/create/{$project->id}", '<i class="fa fa-plus"></i> ' . $this->lang->line('New')),
)
'ctxmenuitems' => array ()
)
);
?>
@ -236,7 +228,6 @@ $this->load->view (
<div class="actions">
<?php if (isset($login['id']) && $login['id'] != ''): ?>
<a id="wiki_show_new_button" href='#'><?php print $this->lang->line('New')?></a>
<a id="wiki_show_edit_button" href='#'><?php print $this->lang->line('Edit')?></a>
<a id="wiki_show_delete_button" href='#'><?php print $this->lang->line('Delete')?></a>
<?php endif; ?>
@ -245,58 +236,51 @@ $this->load->view (
<div style='clear: both'></div>
</div>
<div id="wiki_show_result" class="result">
<div id='wiki_show_metadata' class='collapsible-box'>
<div id='wiki_show_metadata_header' class='collapsible-box-header'><?php print $this->lang->line('Metadata')?></div>
<div id='wiki_show_metadata_body'>
<div id='wiki_show_metadata_list_div'>
<ul id='wiki_show_metadata_list'>
<li><?php print $this->lang->line('Created on')?> <?php print codepot_dbdatetodispdate($wiki->createdon); ?></li>
<li><?php print $this->lang->line('Created by')?> <?php print htmlspecialchars($wiki->createdby); ?></li>
<li><?php print $this->lang->line('Last updated on')?> <?php print codepot_dbdatetodispdate($wiki->updatedon); ?></li>
<li><?php print $this->lang->line('Last updated by')?> <?php print htmlspecialchars($wiki->updatedby); ?></li>
</ul>
</div>
<ul id='wiki_show_metadata_list'>
<li><?php print $this->lang->line('Created on')?> <?php print codepot_dbdatetodispdate($wiki->createdon); ?></li>
<li><?php print $this->lang->line('Created by')?> <?php print htmlspecialchars($wiki->createdby); ?></li>
<li><?php print $this->lang->line('Last updated on')?> <?php print codepot_dbdatetodispdate($wiki->updatedon); ?></li>
<li><?php print $this->lang->line('Last updated by')?> <?php print htmlspecialchars($wiki->updatedby); ?></li>
</ul>
<div id='wiki_show_attachment_list_div'>
<ul id='wiki_show_attachment_list'>
<?php
foreach ($wiki->attachments as $att)
{
$hexattname = $this->converter->AsciiToHex ($att->name);
print '<li>';
print anchor (
"wiki/attachment/{$project->id}/{$hex_wikiname}/{$hexattname}",
htmlspecialchars($att->name)
);
print '</li>';
}
?>
</ul>
</div>
<ul id='wiki_show_file_list'>
<?php
foreach ($wiki->attachments as $att)
{
$hexattname = $this->converter->AsciiToHex ($att->name);
print '<li>';
print anchor (
"wiki/attachment/{$project->id}/{$hex_wikiname}/{$hexattname}",
htmlspecialchars($att->name)
);
print '</li>';
}
?>
</ul>
<div style='clear: both;'></div>
</div>
</div>
<?php
<div id="wiki_show_result" class="result">
<?php
if ($is_html)
{
print $wiki->text;
}
else
{
print '<div class="result" id="wiki_show_wiki">';
print '<div id="wiki_show_wiki">';
print '<pre id="wiki_show_wiki_text" style="visibility: hidden">';
print htmlspecialchars($wiki->text);
print '</pre>';
print '</div>';
}
?>
?>
</div> <!-- wiki_show_result -->

View File

@ -377,7 +377,6 @@ textarea {
}
.content .mainarea .result {
/*min-height: 30em;*/
overflow: auto;
}

View File

@ -1,64 +1,50 @@
/*-----------------------------------------------
* file home view
*-----------------------------------------------*/
#file_home_mainarea_result {
#file_home_result,
#file_show_result {
position: relative;
overflow: auto;
margin: 0.2em 0 0.2em 0;
}
#file_home_mainarea_result_table tr {
#file_home_result_table tr {
vertical-align: middle;
}
/*-----------------------------------------------
* file show view
*-----------------------------------------------*/
#file_show_mainarea_result {
position: relative;
min-height: 13em;
}
#file_show_mainarea_result_info {
position: absolute;
top: 5px;
right: 2px;
width: 22em;
background: #E5ECF9 none repeat scroll 0 0;
border: #D4DBE8 1px solid;
overflow: auto;
padding: 0.2em 0.4em 0.2em 0.4em;
font-size: 0.9em;
}
#file_show_mainarea_result_info ul {
padding-left: 2em;
}
#file_show_mainarea_result_info .title {
background-color: #8888FF;
color: #FFFFFF;
border: #D4DBE8 1px solid;
margin: 0.3em 0 0.3em 0;
padding: 0.1em 0.1em 0.1em 0.1em;
font-size: inherit;
text-transform: uppercase;
}
#file_show_mainarea_files td {
#file_show_files td {
padding-left: 0.5em;
padding-right: 0.5em;
line-height: 1.5em;
white-space: nowrap;
}
#file_show_mainarea_metadata_body,
#file_show_mainarea_files_body {
#file_show_metadata_body,
#file_show_files_body {
background-color: #FCFCFC;
margin: 0 !important;
padding: 0.5em 0.5em 0.5em 0.5em !important;
}
#file_show_mainarea_metadata_body ul {
padding: 0em 0.5em 0em 0.5em;
margin: 0;
#file_show_metadata_list {
padding: 0 !important;
margin: 0 0 0.5em 0 !important;
list-style: outside none none !important;
clear: both;
}
#file_show_metadata_list li {
padding: 0.2em 0.2em 0.2em 0.2em !important;
margin: 0em 0.2em 0.4em 0.2em !important;
float: left !important;
background-color: #EAEAEA !important;
color: #000000 !important;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
/*-----------------------------------------------
@ -95,25 +81,25 @@
/*-----------------------------------------------
* file home show - edit file dialog
*-----------------------------------------------*/
#file_show_mainarea_edit_description_tabs {
#file_show_edit_description_tabs {
border: none !important;
}
#file_show_mainarea_edit_description_tabs .ui-tabs-panel {
#file_show_edit_description_tabs .ui-tabs-panel {
padding: 0.2em 0em 0em 0em !important;
}
#file_show_mainarea_edit_description_tabs .ui-widget-header {
#file_show_edit_description_tabs .ui-widget-header {
border: none !important;
background: none !important;
padding: 0em !important;
}
#file_show_mainarea_edit_description_tabs .ui-tabs-nav {
#file_show_edit_description_tabs .ui-tabs-nav {
padding: 0em !important;
}
/* #file_show_mainarea_edit_description_tabs .ui-tabs-nav li { */
/* #file_show_edit_description_tabs .ui-tabs-nav li { */
.ui-tabs .ui-tabs-nav li.ui-state-default {
border-bottom: 1px solid #cccccc !important;
}

View File

@ -95,8 +95,11 @@ li.issue-owner {
/*---------------------------------------------
* issue home
*---------------------------------------------*/
#issue_home_result {
#issue_home_result,
#issue_show_result {
position: relative;
overflow: auto;
margin: 0.2em 0 0.2em 0;
}
#issue_home_result_table tr {

View File

@ -1,9 +1,32 @@
/*---------------------------------------------
* wiki show
* wiki
*---------------------------------------------*/
#wiki_home_result,
#wiki_show_result {
position: relative;
overflow: auto;
margin: 0.2em 0 0.2em 0;
}
#wiki_show_result pre {
white-space: pre-wrap !important;
}
#wiki_show_result table
{
border-collapse: collapse;
}
#wiki_show_result table td {
border: 1px solid #E0E0E0;
}
#wiki_edit_result {
position: relative;
overflow: hidden !important;
margin: 0.2em 0 0.2em 0;
}
#wiki_show_wiki {
@ -18,41 +41,76 @@
column-gap: 2em;
}
#wiki_show_metadata_body {
#wiki_show_metadata_body,
#wiki_edit_files_body {
background-color: #FCFCFC;
margin: 0 !important;
padding: 0.5em 0.5em 0.5em 0.5em !important;
}
#wiki_show_metadata_body ul {
padding: 0em 0.5em 0em 0.5em;
margin: 0;
}
#wiki_show_metadata_list_div {
float: left;
}
#wiki_show_attachment_list_div {
margin-left: 2em;
float: left;
/*
#wiki_show_file_list a,
*/
#wiki_show_metadata_list,
#wiki_show_file_list,
#wiki_edit_file_list,
#wiki_edit_add_file_list {
padding: 0 !important;
margin: 0 0 0.5em 0 !important;
list-style: outside none none !important;
clear: both;
}
#wiki_show_attachment_list {
#wiki_show_metadata_list li {
padding: 0.2em 0.2em 0.2em 0.2em !important;
margin: 0em 0.2em 0.4em 0.2em !important;
float: left !important;
background-color: #EAEAEA !important;
color: #000000 !important;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
#wiki_show_attachment_list a,
#wiki_show_attachment_list a:visited,
#wiki_show_attachment_list a:focus {
#wiki_show_file_list li,
#wiki_edit_file_list li {
padding: 0.2em 0.2em 0.2em 0.2em !important;
margin: 0em 0.2em 0.4em 0.2em !important;
float: left !important;
/*background-color: #44AD8E !important;*/
background-color: #015067 !important;
color: #FFFFFF !important;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
#wiki_show_file_list a,
#wiki_show_file_list a:visited,
#wiki_show_file_list a:focus {
text-decoration: none;
color: #111111;
}
#wiki_show_attachment_list a:hover {
background-color: #1C94C4;
color: #FFFFFF;
}
/*---------------------------------------------
* wiki edit
*---------------------------------------------*/
#wiki_edit_form {
#wiki_show_file_list a:hover {
color: #90AACC;
}
#wiki_edit_add_file_list li {
padding: 0.2em 0.2em 0.2em 0.2em !important;
margin: 0em 0.2em 0.4em 0.2em !important;
float: left !important;
background-color: #994044 !important;
color: #FFFFFF !important;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
#wiki_edit_file_list .fa,
#wiki_edit_add_file_list .fa {
color: #FFFFFF !important;
}
#wiki_edit_text_area,