function parseaddons($addonspath, $filename, $shop_lang)
{
    global $modx, $modulea, $moduleid, $tables, $tsvshop;
    $out = "";
    $tmp = "";
    $temp = "";
    $num = 1;
    $lang = isset($lang) ? $lang : $modx->config['manager_language'];
    //$filename=$modx->config['base_path'].'assets/snippets/tsvshop/admin/tpl/addonstable.tpl';
    $tpl = get_file_contents($filename);
    if (!empty($addonspath) && !empty($filename)) {
        $folders = scandir($addonspath, 1);
        foreach ($folders as $folder) {
            if ($folder != "." && $folder != ".." && file_exists($addonspath . $folder . "/main.inc.php")) {
                $temp = str_replace('[+moduleid+]', $_GET['id'], $tpl);
                $temp = str_replace('[+lang+]', $lang, $temp);
                $temp = str_replace('[+num+]', $num++, $temp);
                $temp = str_replace('[+addon+]', $shop_lang[$folder . '_title'], $temp);
                if (is_install($folder)) {
                    if ($tables[$folder] == "system") {
                        $temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
                    } else {
                        $temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonuninstall&addon=' . $folder . '" title="' . $shop_lang['addons_uninstall'] . '" onclick="uninstall(\'' . $shop_lang['addons_uninstall_question'] . '\');return false"><img src="' . TSVSHOP_SURL . 'addons/addons/img/uninstall.png" alt="' . $shop_lang['addons_uninstall'] . '" /></a>', $temp);
                    }
                    if (getConf("addons", $folder . "_active") == "yes") {
                        if ($tables[$folder] == "system") {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
                        } else {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_on.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonoff&addon=' . $folder . '" title="' . $shop_lang['addons_off_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_off_act'] . '" /></a>', $temp);
                        }
                    } else {
                        if ($tables[$folder] == "system") {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
                        } else {
                            $temp = str_replace('[+status+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonon&addon=' . $folder . '" title="' . $shop_lang['addons_on_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on_act'] . '" /></a> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_off.png" alt="' . $shop_lang['addons_off'] . '" title="' . $shop_lang['addons_off'] . '" />', $temp);
                        }
                    }
                } else {
                    if ($tables[$folder] == "system") {
                        $temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
                        $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
                    } else {
                        $temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addoninstall&addon=' . $folder . '" title="' . $shop_lang['addons_install'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/install.png" alt="' . $shop_lang['addons_install'] . '" /></a>', $temp);
                        $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
                    }
                }
                $temp = str_replace('[+description+]', $shop_lang[$folder . '_desc'], $temp);
                $out .= $temp;
            }
        }
        $out = preg_replace('/(\\[\\+.*?\\+\\])/', '', $out);
        return $out;
    } else {
        return "";
    }
}
Exemple #2
0
/**
 * @package Helios Calendar
 * @license GNU General Public License version 2 or later; see LICENSE
 */
if (!defined('HCSETUP')) {
    exit(-1);
}
include '../inc/config.php';
session_name('hc_setup_' . md5(HC_Install));
session_start();
$curVersion = "3.0";
$setup = true;
$sID = isset($_GET['step']) && is_numeric($_GET['step']) ? strip_tags($_GET['step']) : 1;
$_SESSION['code_valid'] = isset($_POST['start']) && $_POST['start'] == HC_Install && HC_Install != '' || isset($_SESSION['code_valid']) && $_SESSION['code_valid'] == 1 ? true : false;
$_SESSION['is_install'] = !isset($_SESSION['is_install']) ? is_install() : $_SESSION['is_install'];
function hc_fail()
{
    echo '
		Helios Calendar is unable to continue the Web Setup Wizard for one of the following reasons:
		<ol>
			<li>Sessions are not working correctly for your PHP install.</li>
			<li>You are trying to skip ahead without following each step in order.</li>
		</ol>
		<p style="padding-top:10px;">
			<a href="index.php">Click here to restart the Helios Calendar Web Setup Wizard.</a>
			<br /><br />If you see this message again submit a support ticket by clicking the "Refresh Members Site" link to the right.
		</p>';
}
function php_current($version)
{
Exemple #3
0
                <li id="Button1"><a href="index.php?a=112&id=' . $moduleid . '"><img src="media/style' . $theme . '/images/icons/refresh.png"> ' . $shop_lang['refresh'] . '</a></li>
                <li id="Button1"><a href="#" onclick="getform(\'/manager/index.php\',document.getElementById(\'sconf\'),save_config_ok);"><img src="media/style' . $theme . '/images/icons/save.png"> ' . $shop_lang['save'] . '</a></li>
            </ul>
</td>
            <td id="report"></td>
        </tr>
    </table>';
$output .= '
<div id="sconf">
<form action="javascript:getform(\'/manager/index.php\',document.getElementById(\'sconf\'),save_config_ok);" name="sconf">
<input type="hidden" id="a" name="a" value="' . $modulea . '" />
<input type="hidden" id="id" name="id" value="' . $moduleid . '" />
<input type="hidden" id="act" name="act" value="saveconfig" />';
$output .= '
    <br /><div class="tab-pane" id="resourcesPane1">
        <script type="text/javascript">
        tp1Resources = new WebFXTabPane( document.getElementById( "resourcesPane1" ) );
        </script>';
//тут будет вывод формы конфигурации
foreach ($folders as $folder) {
    if ($folder != "." && $folder != "..") {
        $file = $addonspath . $folder . '/includes/config.form.inc.php';
        if (is_install($folder) && file_exists($file)) {
            require_once $file;
        }
    }
}
//include_once ($addonspath.'config/includes/config.form.inc.php');
//--------------
$output .= '</div></form></div>';
$output .= '</div>';