Browse Source

адаптация для версии ave.cms 3.26

master
parent
commit
2a09302776
  1. 4
      README.md
  2. 9
      faq/class/faq.php
  3. 20
      faq/info.php
  4. 5
      faq/lang/ru.txt
  5. 24
      faq/module.php
  6. 22
      faq/sql.php
  7. 23
      faq/templates/admin_quest_edit.tpl

4
README.md

@ -1,6 +1,6 @@
## faq
# Вопрос | ответ v1.0.1
# Вопрос | ответ v1.26.1
## Модуль создания раширенной справочной системы на основе тегов.
@ -10,4 +10,6 @@
## Changelog:
04.09.2019 - версия 1.26.1
26.11.2015 - версия 1.0.1

9
faq/class.faq.php → faq/class/faq.php

@ -157,9 +157,6 @@ class Faq
);
}
switch ($_SESSION['use_editor'])
{
case '0': // CKEditor
$oCKeditor = new CKeditor();
$oCKeditor->returnOutput = true;
$oCKeditor->config['toolbar'] = 'Verysmall';
@ -173,12 +170,6 @@ class Faq
$oCKeditor2->config['height'] = 400;
$config2 = array();
$faq['faq_answer'] = $oCKeditor2->editor('faq_answer', $faq['faq_answer'], $config2);
break;
case '1':
// Elrte и Elfinder
break;
}
$AVE_Template->assign($faq);

20
faq/info.php

@ -0,0 +1,20 @@
<?php
if (! defined('BASE_DIR'))
exit;
$module = array(
'ModuleSysName' => 'faq',
'ModuleVersion' => '1.26.1',
'ModuleAutor' => 'Freeon',
'ModuleCopyright' => '&copy; 2007-' . date('Y') . ' AVE.cms',
'ModuleStatus' => 1,
'ModuleIsFunction' => 1,
'ModuleTemplate' => 0,
'ModuleAdminEdit' => 1,
'ModuleFunction' => 'mod_faq',
'ModuleTag' => '[mod_faq:XXX]',
'ModuleTagLink' => null,
'ModuleAveTag' => '#\\\[mod_faq:(\\\d+)]#',
'ModulePHPTag' => "<?php mod_faq(''$1''); ?>"
);
?>

5
faq/lang/ru.txt

@ -1,3 +1,8 @@
[name]
MODULE_NAME = "Вопрос/ответ"
MODULE_DESCRIPTION = "Модуль создания раширенной справочной системы на основе тегов."
[module]
FAQ_EDIT = "Редактирование рубрики"
FAQ_EDIT_RUB = "Редактирование рубрики"
FAQ_EDIT_TIP = "В данном разделе представлен список вопросов и ответов выбранной рубрики. Вы можете добавить новый вопрос и ответ на него, перейти к редактированию существующих вопросов и ответов или удалить вопросы и ответы на них."

24
faq/module.php

@ -10,24 +10,6 @@
*/
if (!defined('BASE_DIR')) exit;
if (defined('ACP'))
{
$modul['ModuleName'] = 'Вопрос/ответ';
$modul['ModuleSysName'] = 'faq';
$modul['ModuleVersion'] = '1.0.1';
$modul['ModuleDescription'] = 'Модуль создания раширенной справочной системы на основе тегов.';
$modul['ModuleAutor'] = 'Freeon';
$modul['ModuleCopyright'] = '&copy; 2007-2008 Overdoze Team';
$modul['ModuleStatus'] = 1;
$modul['ModuleIsFunction'] = 1;
$modul['ModuleAdminEdit'] = 1;
$modul['ModuleFunction'] = 'mod_faq';
$modul['ModuleTag'] = '[mod_faq:XXX]';
$modul['ModuleTagLink'] = null;
$modul['ModuleAveTag'] = '#\\\[mod_faq:(\\\d+)]#';
$modul['ModulePHPTag'] = "<?php mod_faq(''$1''); ?>";
}
/**
* Обработка тега модуля
*
@ -54,7 +36,7 @@ function mod_faq($id)
umask($oldumask);
}
require_once(BASE_DIR . '/modules/faq/class.faq.php');
require_once(BASE_DIR . '/modules/faq/class/faq.php');
Faq::faqShow($id);
}
@ -69,12 +51,12 @@ function mod_faq($id)
*/
if (defined('ACP') && !empty($_REQUEST['moduleaction']))
{
require_once(BASE_DIR . '/modules/faq/class.faq.php');
require_once(BASE_DIR . '/modules/faq/class/faq.php');
$tpl_dir = BASE_DIR . '/modules/faq/templates/';
$lang_file = BASE_DIR . '/modules/faq/lang/' . $_SESSION['user_language'] . '.txt';
$AVE_Template->config_load($lang_file);
$AVE_Template->config_load($lang_file, 'module');
switch ($_REQUEST['moduleaction'])
{

22
faq/sql.php

@ -16,27 +16,27 @@ $module_sql_install = array();
$module_sql_deinstall = array();
$module_sql_update = array();
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_faq;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_faq_quest;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS %%PRFX%%_module_faq;";
$module_sql_deinstall[] = "DROP TABLE IF EXISTS %%PRFX%%_module_faq_quest;";
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_faq (
$module_sql_install[] = "CREATE TABLE %%PRFX%%_module_faq (
`id` mediumint(5) unsigned NOT NULL auto_increment,
`faq_title` char(100) NOT NULL default '',
`faq_description` char(255) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;";
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_faq_quest (
$module_sql_install[] = "CREATE TABLE %%PRFX%%_module_faq_quest (
`id` mediumint(5) unsigned NOT NULL auto_increment,
`faq_id` mediumint(5) unsigned NOT NULL default '1',
`faq_quest` text NOT NULL,
`faq_answer` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;";
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_update[] = "
UPDATE
`CPPREFIX_module`
`%%PRFX%%_module`
SET
ModuleAveTag = '" . $modul['ModuleAveTag'] . "',
ModulePHPTag = '" . $modul['ModulePHPTag'] . "',
@ -48,15 +48,15 @@ $module_sql_update[] = "
$module_sql_update[] = "
RENAME TABLE
`CPPREFIX_modul_faq`
`%%PRFX%%_modul_faq`
TO
`CPPREFIX_module_faq`
`%%PRFX%%_module_faq`
";
$module_sql_update[] = "
RENAME TABLE
`CPPREFIX_modul_faq_quest`
`%%PRFX%%_modul_faq_quest`
TO
`CPPREFIX_module_faq_quest`
`%%PRFX%%_module_faq_quest`
";
?>

23
faq/templates/admin_quest_edit.tpl

@ -1,25 +1,4 @@
{if $smarty.session.use_editor == 0}
<script type="text/javascript" src="{$ABS_PATH}lib/redactor/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="{$ABS_PATH}lib/redactor/ckeditor/vendor/jquery.spellchecker.js"></script>
<link rel="stylesheet" href="{$ABS_PATH}lib/redactor/ckeditor/vendor/jquery.spellchecker.css" type="text/css" media="all" />
{/if}
{if $smarty.session.use_editor == 1}
<!-- elrte -->
<link rel="stylesheet" href="{$ABS_PATH}lib/redactor/redactor/elrte/css/elrte.full.css" type="text/css" media="screen" />
<script src="{$ABS_PATH}lib/redactor/redactor/elrte/js/elrte.full.js" type="text/javascript"></script>
<script src="{$ABS_PATH}lib/redactor/redactor/elrte/js/i18n/elrte.ru.js" type="text/javascript"></script>
<!-- elfinder -->
<link rel="stylesheet" href="{$ABS_PATH}lib/redactor/redactor/elfinder/css/elfinder.full.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{$ABS_PATH}lib/redactor/redactor/elfinder/css/theme.css" type="text/css" media="screen" />
<script src="{$ABS_PATH}lib/redactor/redactor/elfinder/js/elfinder.full.js" type="text/javascript"></script>
<script src="{$ABS_PATH}lib/redactor/redactor/elfinder/js/i18n/elfinder.ru.js" type="text/javascript"></script>
<script src="{$ABS_PATH}lib/redactor/redactor/elfinder/js/jquery.dialogelfinder.js" type="text/javascript"></script>
<script type="text/javascript" src="{$tpl_dir}/js/rle.js"></script>
{/if}
<script type="text/javascript" src="{$ABS_PATH}lib/redactor/ckeditor/ckeditor.js"></script>
<div class="title">
<h5>{#FAQ_INSERT_H#}</h5>

Loading…
Cancel
Save