예제 #1
0
<?php

defined('_JEXEC') or die('Restricted access');
/**
 * gets $action, $data , and working framework, so globals and helper works
 * response from helperUG
 */
switch ($action) {
    case "update_thumbpanel_defaults":
        UGGridThemeHelper::updateThumbPanelDefaults($data);
        $urlRedirect = HelperGalleryUG::getUrlViewCurrentGallery();
        HelperUG::ajaxResponseSuccessRedirect("Position settings updated successfully", $urlRedirect);
        break;
    default:
        HelperUG::ajaxResponseError("wrong ajax action (Compact Theme): <b>{$action}</b> ");
        break;
}
<?php

defined('_JEXEC') or die('Restricted access');
require GlobalsUG::$pathHelpersSettings . "main.php";
$settingsParams = new UniteGallerySettingsUG();
$settingsParams->loadXMLFile(GlobalsUGGallery::$pathSettings . "gallery_settings.xml");
//set defaults
$arrDefaults = array("slider_controls_always_on" => "true");
//set defaults by position
if (!isset($panelPos)) {
    $panelPos = UniteFunctionsUG::getGetVar("thumbpos", "right");
}
$arrPosDefaults = UGGridThemeHelper::getDefautlsByPosition($panelPos);
$arrDefaults = array_merge($arrDefaults, $arrPosDefaults);
$arrSettingsToHide = array();
//$settingsParams->hideSettings($arrSettingsToHide);
$settingsParams->setStoredValues($arrDefaults);
// get merged settings with values
$valuesMain = $settingsMain->getArrValues();
$valuesParams = $settingsParams->getArrValues();
$valuesMerged = array_merge($valuesMain, $valuesParams);
$valuesMerged["gallery_theme"] = "grid";