Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
1b9dcca6
Commit
1b9dcca6
authored
Oct 04, 2010
by
filip
Browse files
Added manage questions functionality to FAQ for admin.
parent
9b0a821d
Changes
11
Hide whitespace changes
Inline
Side-by-side
interface/web/help/faq_delete.php
View file @
1b9dcca6
<?php
// From and List definition files
$list_def_file
=
'list/faq_list.php'
;
$list_def_file
=
'list/faq_
manage_questions_
list.php'
;
$tform_def_file
=
'form/faq.tform.php'
;
// Include the base libraries
...
...
interface/web/help/faq_manage_questions_list.php
0 → 100644
View file @
1b9dcca6
<?php
require_once
(
'../../lib/config.inc.php'
);
require_once
(
'../../lib/app.inc.php'
);
//* Path to the list definition file
$list_def_file
=
"list/faq_manage_questions_list.php"
;
//* Check permissions for module
$app
->
auth
->
check_module_permissions
(
'help'
);
//* Loading the class
$app
->
uses
(
'listform_actions'
);
//* Optional limit
#$app->listform_actions->SQLExtWhere = "recipient_id = ".$_SESSION['s']['user']['userid'];
//* Start the form rendering and action ahndling
$app
->
listform_actions
->
onLoad
();
?>
interface/web/help/form/faq.tform.php
View file @
1b9dcca6
...
...
@@ -27,7 +27,7 @@ $form['db_history'] = 'no';
$form
[
'tab_default'
]
=
'message'
;
// The name of the default list file of this form
$form
[
'list_default'
]
=
'faq_list.php'
;
$form
[
'list_default'
]
=
'faq_
manage_questions_
list.php'
;
// Use the internal authentication system for this table. This should
// be set to 'yes' in most cases, otherwise 'no'.
...
...
interface/web/help/lib/lang/cz.lng
View file @
1b9dcca6
...
...
@@ -9,5 +9,6 @@ $wb['Version'] = 'Verze';
$wb
[
'Frequently Asked Questions'
]
=
'Často kladené dotazy'
;
$wb
[
'FAQ Sections'
]
=
'Sekce FAQ'
;
$wb
[
'Manage Sections'
]
=
'Spravovat sekce'
;
$wb
[
'Manage Questions'
]
=
'Spravovat dotazy'
;
$wb
[
'Add a Question & Answer Pair'
]
=
'Přidat otázku a odpověď'
;
?>
interface/web/help/lib/lang/cz_faq_manage_questions_list.lng
0 → 100644
View file @
1b9dcca6
<?php
$wb
[
'faq_question_txt'
]
=
"Otázka"
;
$wb
[
'faq_section_name_txt'
]
=
"Název sekce"
;
$wb
[
'faq_delete_txt'
]
=
"Smazat"
;
$wb
[
'faq_edit_txt'
]
=
"Upravit"
;
$wb
[
'faq_sections_txt'
]
=
"Sekce"
;
$wb
[
'faq_faq_questions_txt'
]
=
"Často kladené dotazy"
;
$wb
[
'faq_new_question_txt'
]
=
"Přidat nový dotaz"
;
?>
interface/web/help/lib/lang/en.lng
View file @
1b9dcca6
...
...
@@ -10,6 +10,6 @@ $wb['Frequently Asked Questions'] = 'Frequently Asked Questions';
$wb
[
'FAQ Sections'
]
=
'FAQ Sections'
;
$wb
[
'Manage Sections'
]
=
'Manage Sections'
;
$wb
[
'Add a Question & Answer Pair'
]
=
'Add a Question & Answer Pair'
;
$wb
[
'Manage Questions'
]
=
'Manage Questions'
;
?>
interface/web/help/lib/lang/en_faq_manage_questions_list.lng
0 → 100644
View file @
1b9dcca6
<?php
$wb
[
'faq_question_txt'
]
=
"Question"
;
$wb
[
'faq_section_name_txt'
]
=
"Section"
;
$wb
[
'faq_delete_txt'
]
=
"Delete"
;
$wb
[
'faq_edit_txt'
]
=
"Edit"
;
$wb
[
'faq_sections_txt'
]
=
"Section"
;
$wb
[
'faq_faq_questions_txt'
]
=
"Frequently Asked Questions"
;
$wb
[
'faq_new_question_txt'
]
=
"Add a new question & answer pair"
;
?>
interface/web/help/lib/module.conf.php
View file @
1b9dcca6
...
...
@@ -46,21 +46,24 @@ $module['nav'][] = array( 'title' => 'Support',
$itemsfaq
=
array
();
//* admin's tools
if
(
$_SESSION
[
's'
][
'user'
][
'typ'
]
==
'admin'
)
{
$itemsfaq
[]
=
array
(
'title'
=>
'
Add a
Question
& Answer Pair
'
,
$itemsfaq
[]
=
array
(
'title'
=>
'
Manage
Question
s
'
,
'target'
=>
'content'
,
'link'
=>
'help/faq_
edi
t.php'
);
'link'
=>
'help/faq_
manage_questions_lis
t.php'
);
$itemsfaq
[]
=
array
(
'title'
=>
'Manage Sections'
,
'target'
=>
'content'
,
'link'
=>
'help/faq_sections_list.php'
);
}
$sql
=
"SELECT * FROM help_faq_sections"
;
$res
=
$app
->
db
->
queryAllRecords
(
$sql
);
//* all the content sections
if
(
is_array
(
$res
))
{
foreach
(
$res
as
$v
)
{
$itemsfaq
[]
=
array
(
'title'
=>
$v
[
'hfs_name'
],
'target'
=>
'content'
,
'link'
=>
'help/faq_list.php?hfs_id='
.
$v
[
'hfs_id'
]);
else
{
//* the user
$sql
=
"SELECT * FROM help_faq_sections"
;
$res
=
$app
->
db
->
queryAllRecords
(
$sql
);
//* all the content sections
if
(
is_array
(
$res
))
{
foreach
(
$res
as
$v
)
{
$itemsfaq
[]
=
array
(
'title'
=>
$v
[
'hfs_name'
],
'target'
=>
'content'
,
'link'
=>
'help/faq_list.php?hfs_id='
.
$v
[
'hfs_id'
]);
}
}
}
...
...
interface/web/help/list/faq_list.php
View file @
1b9dcca6
...
...
@@ -16,7 +16,7 @@ $liste['table_idx'] = 'hf_id';
$liste
[
'records_per_page'
]
=
100
;
// Script File of the list
$liste
[
'file'
]
=
'faq_list.php'
;
$liste
[
'file'
]
=
'faq_
manage_questions_
list.php'
;
// Script file of the edit form
$liste
[
'edit_file'
]
=
'faq_edit.php'
;
...
...
interface/web/help/list/faq_manage_questions_list.php
0 → 100644
View file @
1b9dcca6
<?php
// Name of the list
$liste
[
'name'
]
=
'faq_manage_questions'
;
// Database table
$liste
[
'table'
]
=
'help_faq'
;
// Index index field of the database table
$liste
[
'table_idx'
]
=
'hf_id'
;
// Search Field Prefix
#$liste['search_prefix'] = 'search_';
// Records per page
$liste
[
'records_per_page'
]
=
30
;
// Script File of the list
$liste
[
'file'
]
=
'faq_manage_questions_list.php'
;
// Script file of the edit form
$liste
[
'edit_file'
]
=
'faq_edit.php'
;
// Script File of the delete script
$liste
[
'delete_file'
]
=
'faq_delete.php'
;
// Paging Template
$liste
[
'paging_tpl'
]
=
'templates/paging.tpl.htm'
;
// Enable auth
$liste
[
'auth'
]
=
'yes'
;
$liste
[
"item"
][]
=
array
(
'field'
=>
"hf_section"
,
'datatype'
=>
"VARCHAR"
,
'formtype'
=>
"SELECT"
,
'op'
=>
"="
,
'prefix'
=>
""
,
'suffix'
=>
""
,
'datasource'
=>
array
(
'type'
=>
'SQL'
,
'querystring'
=>
'SELECT a.hf_section, b.hfs_name FROM help_faq a, help_faq_sections b WHERE (a.hf_section = b.hfs_id)'
,
'keyfield'
=>
'hf_section'
,
'valuefield'
=>
'hfs_name'
),
'width'
=>
""
,
'value'
=>
""
);
?>
interface/web/help/templates/faq_manage_questions_list.htm
0 → 100644
View file @
1b9dcca6
<h2>
{tmpl_var name="faq_faq_questions_txt"}
</h2>
<div
class=
"pnl_toolsarea"
>
<fieldset><legend>
{tmpl_var name="toolsarea_head_txt"}
</legend>
<div
class=
"buttons"
>
<button
class=
"iconstxt icoAdd"
type=
"button"
onclick=
"loadContent('help/faq_edit.php');"
>
<span>
{tmpl_var name="faq_new_question_txt"}
</span>
</button>
</div>
</fieldset>
</div>
<div
class=
"pnl_listarea"
>
<fieldset><legend><tmpl_var
name=
"faq_sections_txt"
></legend>
<table
class=
"list"
>
<thead>
<tr>
<th
class=
"tbl_col_active"
scope=
"col"
>
{tmpl_var name="faq_question_txt"}
</th>
<th
class=
"tbl_col_active"
scope=
"col"
>
{tmpl_var name="faq_section_name_txt"}
</th>
<th
class=
"tbl_col_server_id"
scope=
"col"
>
{tmpl_var name="faq_delete_txt"}
</th>
<th
class=
"tbl_col_domain"
scope=
"col"
>
{tmpl_var name="faq_edit_txt"}
</th>
</tr>
</thead>
<tmpl_loop
name=
"records"
>
<tr>
<td>
{tmpl_var name='hf_question'}
</td>
<td>
{tmpl_var name='hf_section'}
</td>
<td>
<div
class=
"buttons icons16"
>
<a
class=
"icons16 icoDelete"
href=
"javascript: del_record('help/faq_delete.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"
>
<span>
{tmpl_var name="faq_delete_txt"}
</span></a>
</div>
</td>
<td>
<a
href=
"#"
onClick=
"loadContent('help/faq_edit.php?id={tmpl_var name='id'}');"
>
{tmpl_var name="faq_edit_txt"}
</a>
</td>
</tr>
</tmpl_loop>
</table>
</fieldset>
</div>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment