Exemplo n.º 1
0
<?php

/**
 * @package Unite Gallery for Joomla 1.7-3.5
 * @author UniteCMS.net / Valiano
 * @copyright (C) 2012 Unite CMS, All Rights Reserved. 
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * */
defined('_JEXEC') or die('Restricted access');
$filepathItemSettings = GlobalsUG::$pathSettings . "item_settings.xml";
$settingsItem = new UniteSettingsAdvancedUG();
$settingsItem->loadXMLFile($filepathItemSettings);
 /**
  * 
  * write settings language file for wp automatic scanning
  */
 public static function writeSettingLanguageFile($filepath)
 {
     $info = pathinfo($filepath);
     $path = UniteFunctionsUG::getVal($info, "dirname") . "/";
     $filename = UniteFunctionsUG::getVal($info, "filename");
     $ext = UniteFunctionsUG::getVal($info, "extension");
     $filenameOutput = "{$filename}_{$ext}_lang.php";
     $filepathOutput = $path . $filenameOutput;
     //load settings
     $settings = new UniteSettingsAdvancedUG();
     $settings->loadXMLFile($filepath);
     $arrText = $settings->getArrTextFromAllSettings();
     $str = "";
     $str .= "<?php \n";
     foreach ($arrText as $text) {
         $text = str_replace('"', '\\"', $text);
         $str .= "_e(\"{$text}\",\"" . UNITEGALLERY_TEXTDOMAIN . "\"); \n";
     }
     $str .= "?>";
     UniteFunctionsUG::writeFile($str, $filepathOutput);
 }