mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Docs administration - docs index (render all docs at once)
This commit is contained in:
parent
8579ad8a87
commit
2847dc75c7
@ -9,8 +9,8 @@
|
||||
* Docs
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/docs.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2008-12-16 15:16:09 $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-01-05 16:08:38 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@ -22,35 +22,83 @@ if (!ADMIN) {
|
||||
$e_sub_cat = 'docs';
|
||||
require_once("auth.php");
|
||||
|
||||
$i = 1;
|
||||
$lang = e_LANGUAGE;
|
||||
if (!$handle = opendir(e_DOCS.e_LANGUAGE."/")) {
|
||||
$lang = "English";
|
||||
$handle = opendir(e_DOCS."English/");
|
||||
require_once ('../e107_handlers/file_class.php');
|
||||
$fl = new e_file();
|
||||
$doc_fpath = e_DOCS.e_LANGUAGE.'/';
|
||||
$doc_fpath_alt = e_DOCS.'English/';
|
||||
|
||||
$helplist_all = $fl->get_files($doc_fpath_alt);
|
||||
if(!is_dir($doc_fpath) || $doc_fpath == $doc_fpath_alt)
|
||||
{
|
||||
$helplist = $helplist_all;
|
||||
}
|
||||
else
|
||||
{
|
||||
$helplist = $fl->get_files($doc_fpath);
|
||||
}
|
||||
|
||||
while ($file = readdir($handle)) {
|
||||
if ($file != "." && $file != ".." && $file != "CVS") {
|
||||
$helplist[$i] = $file;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
//Titles in Admin Area are requested by the community
|
||||
define('e_PAGETITLE', LAN_DOCS);
|
||||
|
||||
if (e_QUERY) {
|
||||
$filename = e_DOCS.$lang."/".$helplist[e_QUERY];
|
||||
$fd = fopen ($filename, "r");
|
||||
$text .= fread ($fd, filesize ($filename));
|
||||
fclose ($fd);
|
||||
$i = intval(e_QUERY) - 1;
|
||||
$filename = $doc_fpath.$helplist[$i]['fname'];
|
||||
$filename_alt = $doc_fpath_alt.$helplist[$i]['fname'];
|
||||
|
||||
if(is_readable($filename)) $text = file_get_contents($filename);
|
||||
else $text = file_get_contents($filename_alt);
|
||||
|
||||
$text = $tp->toHTML($text, TRUE);
|
||||
$text = preg_replace("/Q\>(.*?)A>/si", "<img src='".e_IMAGE_ABS."generic/question.png' class='icon' alt='' /><b>\\1</b>A>", $text);
|
||||
$text = str_replace("A>", "<img src='".e_IMAGE."generic/answer.png' class='icon' alt='' />", $text);
|
||||
$text = preg_replace('/Q\>(.*?)A>/si', "<img src='".e_IMAGE_ABS."generic/question.png' class='icon' alt='Q' /><strong>\\1</strong>A>", $text);
|
||||
$text = str_replace("A>", "<img src='".e_IMAGE_ABS."generic/answer.png' class='icon' alt='A' />", $text);
|
||||
|
||||
$ns->tablerender(str_replace("_", " ", $helplist[e_QUERY]), $text."<br />");
|
||||
$ns->tablerender(LAN_DOCS.' - '.str_replace("_", " ", $helplist[$i]['fname']), $text);
|
||||
unset($text);
|
||||
require_once("footer.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* NEW 0.8
|
||||
* Show All
|
||||
*/
|
||||
|
||||
$text = '';
|
||||
$text_h = '';
|
||||
foreach ($helplist_all as $key => $helpdata)
|
||||
{
|
||||
$filename = $doc_fpath.$helpdata['fname'];
|
||||
$filename_alt = $doc_fpath_alt.$$helpdata['fname'];
|
||||
|
||||
if(is_readable($filename)) $tmp = file_get_contents($filename);
|
||||
else $tmp = file_get_contents($filename_alt);
|
||||
|
||||
//$tmp = $tp->toHTML(trim($tmp), TRUE);
|
||||
$tmp = preg_replace('/Q\>(.*?)A>/si', "###QSTART###<div class='qitem'><img src='".e_IMAGE_ABS."generic/question.png' class='icon S16 middle' alt='".LAN_DOCS_QUESTION."' />\\1</div>###QEND###", $tmp);
|
||||
$tmp = preg_replace('/###QEND###(.*?)###QSTART###/si', "<div class='aitem'><img src='".e_IMAGE_ABS."generic/answer.png' class='icon S16 middle' alt='".LAN_DOCS_ANSWER."' />\\1</div>", $tmp);
|
||||
$tmp = str_replace(array('###QSTART###', '###QEND###'), array('', "<div class='aitem'><img src='".e_IMAGE_ABS."generic/answer.png' class='icon S16 middle' alt='".LAN_DOCS_ANSWER."' />"), $tmp)."</div>";
|
||||
|
||||
$id = 'doc-'.$key;
|
||||
$text_h .= "
|
||||
<div class='qitem'><img src='".e_IMAGE_ABS."admin_images/docs_16.png' class='icon S16 middle' alt='' /> <a href='#{$id}' class='scroll-to'>".str_replace("_", " ", $helpdata['fname'])."</a></div>
|
||||
";
|
||||
$text .= "
|
||||
<div class='docs-item' id='{$id}'>
|
||||
<h4>".str_replace("_", " ", $helpdata['fname'])."</h4>
|
||||
{$tmp}
|
||||
<div class='gotop'><a href='#docs-list' class='scroll-to'>".LAN_DOCS_GOTOP."</a></div>
|
||||
</div>";
|
||||
|
||||
}
|
||||
|
||||
$text_h = "<div id='docs-list'><h4>".LAN_DOCS_SECTIONS."</h4>".$text_h."</div>";
|
||||
$text = $text_h.$text;
|
||||
|
||||
//Allow scroll navigation for bottom sections
|
||||
$text .= "
|
||||
<div id='docs-bottom-nav'><!-- --></div>
|
||||
";
|
||||
|
||||
$e107->ns->tablerender(LAN_DOCS, $text, 'docs');
|
||||
require_once("footer.php");
|
||||
?>
|
@ -1,3 +1,7 @@
|
||||
<?php
|
||||
|
||||
define("LAN_DOCS", "System Docs");
|
||||
define("LAN_DOCS_SECTIONS", "Sections");
|
||||
define("LAN_DOCS_GOTOP", "Go to top");
|
||||
define("LAN_DOCS_ANSWER", "Answer");
|
||||
define("LAN_DOCS_QUESTION", "Question");
|
||||
?>
|
@ -328,12 +328,30 @@ input.action.edit {}
|
||||
/********** Element Loading Status default style */
|
||||
.element-loading-mask { background-repeat: no-repeat; background-position: 50% 50%; background-color: #f5f5f5; }
|
||||
|
||||
/********** Docs */
|
||||
#docs-list { padding: 10px; margin-bottom: 15px; border: 1px solid #f5f5f5; }
|
||||
#docs-list .qitem { margin: 3px 0; padding-left: 10px; }
|
||||
.docs-item { padding: 10px; margin: 15px 0; border: 1px solid #f5f5f5; }
|
||||
|
||||
.docs-item .qitem,
|
||||
.docs-item .aitem,
|
||||
.docs-item .gotop { margin: 3px 0; padding-left: 10px; }
|
||||
|
||||
.docs-item .qitem { font-weight: bold; }
|
||||
.docs-item .aitem { margin-bottom: 10px; }
|
||||
|
||||
.docs-item h4,
|
||||
#docs-list h4 { margin-bottom: 8px; }
|
||||
|
||||
#docs-bottom-nav { height: 800px; }
|
||||
|
||||
/********** Misc */
|
||||
.e-pointer { cursor: pointer; } /* Pointer Hand */
|
||||
.expand-container { padding: 10px; } /* Block with expandable items */
|
||||
.nextprev-bar { clear: both; padding: 5px; font-size: 14px; margin: 5px; border:1px solid #ddd; } /* Page NextPrev nabigation block */
|
||||
.imgselector-container { clear: both; } /* ImageSelector.sc */
|
||||
|
||||
|
||||
/*******************************************************************************************************************/
|
||||
|
||||
|
||||
@ -479,6 +497,16 @@ ul.plugin-navigation ul.plugin-navigation-sub a.link-active {font-weight: bold;}
|
||||
#dataform {} /* Form tag ID - Default front page - old core definition */
|
||||
#core-meta-settings {} /* General meta settings - Default front page */
|
||||
|
||||
/* newspost.php */
|
||||
#core-newspost-list {}
|
||||
#core-newspost-edit {}
|
||||
#core-newspost-edit-options {}
|
||||
#core-newspost-cat-edit {}
|
||||
#core-newspost-cat-list {}
|
||||
#core-newspost-settings {}
|
||||
#core-newspost-sn-list {}
|
||||
|
||||
|
||||
/* prefs.php */
|
||||
#core-prefs {} /* Main continer - contains all block lemenst from bewlow */
|
||||
#core-prefs-main {} /* Settings section - Site Information */
|
||||
@ -498,4 +526,18 @@ ul.plugin-navigation ul.plugin-navigation-sub a.link-active {font-weight: bold;}
|
||||
#core-search-edit {} /* Edit search settings for specific area */
|
||||
#core-search-settings {} /* General search settings */
|
||||
|
||||
/* ugflag.php */
|
||||
#core-ugflag {}
|
||||
|
||||
/* updateadmin.php */
|
||||
#core-updateadmin {}
|
||||
|
||||
/* upload.php */
|
||||
#core-upload-filetypes {}
|
||||
#core-upload-options {}
|
||||
#core-upload-list {}
|
||||
|
||||
/* wmessage.php */
|
||||
#core-wmessage-list {}
|
||||
#core-wmessage-create {}
|
||||
#core-wmessage-settings {}
|
Loading…
x
Reference in New Issue
Block a user