Exemplo n.º 1
0
 /**
  * @param string $locale
  * @return string[][]
  * @throws UnknownLocaleException
  */
 protected function getDictionaries($locale)
 {
     if (is_null($this->dictionaries)) {
         $this->dictionaries = $this->loadDictionaries($this->dictionaryPaths, $this->localizer->getAvailableLocales());
     }
     if (!array_key_exists($locale, $this->dictionaries)) {
         throw new UnknownLocaleException(sprintf('Cannot translate for unknown locale %s', $locale));
     }
     return $this->dictionaries[$locale];
 }
Exemplo n.º 2
0
 /**
  * Return the current instance
  *
  * @param array $arrAccepted All accepted languages
  * @param string $strDefault Default language code
  * @return Localizer
  */
 public static function getInstance($arrAccepted = array(), $strDefault = 'de')
 {
     if (self::$instance === NULL) {
         self::$instance = new self($arrAccepted, $strDefault);
     }
     return self::$instance;
 }
 public function setLanguage($language)
 {
     if (is_file("lang/" . $language . ".xml")) {
         self::$dictionary = simplexml_load_file("lang/" . $language . ".xml");
     } else {
         self::$dictionary = simplexml_load_file("lang/ru.xml");
     }
     self::$lang = $language;
 }
Exemplo n.º 4
0
 public static function sendPasswordResetLink(\Member $member)
 {
     $email = $member->getEmail();
     $locale = Localizer::get('mail.password_reset');
     $num = $member->getNum();
     $now = time();
     $email = $member->getEmail();
     $href = Router::toModule('manage', 'do_reset_password', ['num' => $num, 'exp' => time(), 'hash' => Cryption::getPasswordResetToken($num, $now, $email)]);
     return self::send($email, \Tbmt\view\Factory::buildMemberFullNameString($member), $locale['subject'], Localizer::insert($locale['body'], ['link' => $href], false));
 }
Exemplo n.º 5
0
 /**
  * @param string $acceptedLanguagesString
  * @param array $fallBacks
  * @param string $default
  * @param array|null $categories
  *
  * @return Localizer
  */
 public static function fromAcceptedLanguages($acceptedLanguagesString, array $fallBacks = array(), $default = 'C', array $categories = array(LC_ALL))
 {
     $acceptedLanguageArray = array($default => 0.0);
     foreach (explode(',', $acceptedLanguagesString) as $lang) {
         if (preg_match('/([a-z-]{2,})(?:;q=(.+))?/i', $lang, $matches) === 0) {
             continue;
         }
         $localeParts = explode('_', strtr($matches[1], array('-' => '_')));
         $localeCode = strtolower($localeParts[0]) . (isset($localeParts[1]) ? '_' . strtoupper($localeParts[1]) : null);
         $acceptedLanguageArray[$localeCode] = isset($matches[2]) ? (double) $matches[2] : 1.0;
     }
     uasort($acceptedLanguageArray, function ($a, $b) {
         if ($a === $b) {
             return 0;
         } elseif ($a < $b) {
             return 1;
         } else {
             return 0;
         }
     });
     sort($categories);
     $localesToSet = array_keys($acceptedLanguageArray);
     $localizer = new Localizer();
     $localeArr = array_fill_keys($categories, $localesToSet);
     if (isset($localeArr[LC_ALL]) === true) {
         // special case wa?
         foreach ($fallBacks as $cat => $localeMap) {
             $localeArr[$cat] = $localeArr[LC_ALL];
         }
     }
     foreach ($localeArr as $cat => $locales) {
         for ($i = 0; $i < count($locales); ++$i) {
             if (isset($fallBacks[$cat][$locales[$i]]) === false) {
                 continue;
             }
             $localeArr[$cat][$i] = $fallBacks[$cat][$locales[$i]];
         }
         $localeArr[$cat] = array_unique($localeArr[$cat]);
     }
     $localizer->setLocale($localeArr);
     return $localizer;
 }
Exemplo n.º 6
0
 public function buildInvitationTypeSelectGroup($fieldKey, $offType)
 {
     $label = Arr::init($this->labels, $fieldKey);
     $value = Arr::init($this->values, $fieldKey);
     $error = Arr::init($this->errors, $fieldKey);
     $memberTypes = Localizer::get('common.member_types');
     $fieldId = $this->formName . $fieldKey;
     $offType--;
     $group = '<div class="field">' . '<label for="' . $fieldId . '">' . $label . '</label>' . '<select name="' . $fieldKey . '">';
     for ($i = $offType; $i >= \Member::TYPE_MEMBER; $i--) {
         $group .= '<option value="' . $i . '">' . $memberTypes[$i] . '</option>';
     }
     $group .= '</select></div>';
     return $group;
 }
Exemplo n.º 7
0
 /**
  * @Acl(action="delete")
  */
 public function deleteAction()
 {
     $this->_helper->acl->check('language', 'delete');
     $language = $this->getLanguage();
     if ($language->getCode() === 'en') {
         $this->_helper->flashMessenger->addMessage(getGS('English language cannot be removed.'));
         $this->_helper->redirector('index', 'languages', 'admin');
     }
     if ($this->repository->isUsed($language)) {
         $this->_helper->flashMessenger->addMessage(getGS('Language is in use and cannot be removed.'));
         $this->_helper->redirector('index', 'languages', 'admin');
     }
     Localizer::DeleteLanguageFiles($language->getCode());
     $this->repository->delete($language->getId());
     $this->_helper->flashMessenger->addMessage(getGS('Language removed.'));
     $this->_helper->redirector('index', 'languages', 'admin');
 }
Exemplo n.º 8
0
 public function buildInvitationTypeSelectGroup($fieldKey, $loginType)
 {
     $label = Arr::init($this->labels, $fieldKey);
     $value = Arr::init($this->values, $fieldKey);
     $error = Arr::init($this->errors, $fieldKey);
     $memberTypes = Localizer::get('common.member_types');
     $types = self::$invitationMapping[$loginType];
     $fieldId = $this->formName . $fieldKey;
     $group = '<div class="field">' . '<label for="' . $fieldId . '">' . $label . '</label>' . '<select name="' . $fieldKey . '" id="' . $fieldId . '" >';
     foreach ($types as $type) {
         $selected = '';
         if ($value == $type) {
             $selected = 'selected="selected"';
         }
         $group .= '<option value="' . $type . '" ' . $selected . '>' . $memberTypes[$type] . '</option>';
     }
     $group .= '</select></div>';
     return $group;
 }
Exemplo n.º 9
0
 public static function localizeErrors($results, $filters)
 {
     $locales = [];
     $invalid = false;
     foreach ($results as $key => $valid) {
         if ($valid === false) {
             $invalid = true;
             $filter = $filters[$key];
             if (isset($filter['errorLabel'])) {
                 $locales[$key] = Localizer::get($filter['errorLabel']);
             } else {
                 $filterCode = $filter;
                 if (isset($filter['filter'])) {
                     $filterCode = $filter['filter'];
                 }
                 $locales[$key] = Localizer::get(self::$FILTER_ERROR_KEYS[$filterCode]);
             }
         } else {
             $locales[$key] = '';
         }
     }
     return $invalid === false ? false : $locales;
 }
Exemplo n.º 10
0
 protected function parseUserValue($value)
 {
     global $smwgHistoricTypeNamespace;
     if ($this->m_caption === false) {
         $this->m_caption = $value;
     }
     $valueParts = explode(':', $value, 2);
     $contentLanguage = $this->getOptionBy(self::OPT_CONTENT_LANGUAGE);
     if ($smwgHistoricTypeNamespace && count($valueParts) > 1) {
         $namespace = smwfNormalTitleText($valueParts[0]);
         $value = $valueParts[1];
         $typeNamespace = Localizer::getInstance()->getLanguage($contentLanguage)->getNsText(SMW_NS_TYPE);
         if ($namespace != $typeNamespace) {
             $this->addErrorMsg(array('smw_wrong_namespace', $typeNamespace));
         }
     }
     if ($value !== '' && $value[0] === '_') {
         $this->m_typeId = $value;
     } else {
         $this->m_givenLabel = smwfNormalTitleText($value);
         $this->m_typeId = DataTypeRegistry::getInstance()->findTypeIdByLanguage($this->m_givenLabel, $contentLanguage);
     }
     if ($this->m_typeId === '') {
         $this->addErrorMsg(array('smw_unknowntype', $this->m_givenLabel));
         $this->m_realLabel = $this->m_givenLabel;
     } else {
         $this->m_realLabel = DataTypeRegistry::getInstance()->findTypeLabel($this->m_typeId);
     }
     $this->m_isAlias = $this->m_realLabel === $this->m_givenLabel ? false : true;
     try {
         $this->m_dataitem = self::getTypeUriFromTypeId($this->m_typeId);
     } catch (SMWDataItemException $e) {
         $this->m_dataitem = self::getTypeUriFromTypeId('notype');
         $this->addErrorMsg(array('smw-datavalue-type-invalid-typeuri', $this->m_typeId));
     }
 }
Exemplo n.º 11
0
	/**
	 * Get all supported languages as an array of LanguageMetadata objects.
	 * @return array
	 */
	function getLanguages()
	{
	    global $g_localizerConfig;
	    $fileName = $g_localizerConfig['TRANSLATION_DIR']
	               .$g_localizerConfig['LANGUAGE_METADATA_FILENAME'];
    	if (file_exists($fileName)) {
    		$xml = File::readAll($path);
    		File::rewind($path, FILE_MODE_READ);
    		$handle = new XML_Unserializer($this->m_unserializeOptions);
        	$handle->unserialize($xml);
        	$arr = $handle->getUnserializedData();
            $languages = $arr['language'];
            foreach ($languages as $language) {
                $languageDef = new LanguageMetadata();
                $languageDef->m_languageId = $language['Code'];
                $languageDef->m_languageCode = '';
                $languageDef->m_countryCode = '';
                $languageDef->m_englishName = '';
                $languageDef->m_nativeName = '';
            }
        } else {
            return Localizer::GetLanguages();
        }
	} // fn getLanguages
Exemplo n.º 12
0
define('API_DIR', BASE_DIR . 'api' . DIRECTORY_SEPARATOR);
define('MODULES_DIR', BASE_DIR . 'modules' . DIRECTORY_SEPARATOR);
define('VIEWS_DIR', BASE_DIR . 'views' . DIRECTORY_SEPARATOR);
define('LOCALES_DIR', BASE_DIR . 'locales' . DIRECTORY_SEPARATOR);
require INC_DIR . 'Exceptions.php';
require INC_DIR . 'Val.php';
require INC_DIR . 'Config.php';
require INC_DIR . 'Localizer.php';
require INC_DIR . 'Router.php';
require INC_DIR . 'ControllerDispatcher.php';
Config::load(CONFIG_DIR . 'cfg.json');
$baseUrl = Config::get('baseurl');
if (!$baseUrl) {
    throw new \Exception('Invalid configuration. Missing "baseurl" definition.');
}
Localizer::load(LOCALES_DIR);
Router::init($baseUrl);
/* Setup propel
---------------------------------------------*/
set_include_path(get_include_path() . PATH_SEPARATOR . ENTITIES_CLASSES_DIR . LIB_DIR . PATH_SEPARATOR . BASE_DIR . PATH_SEPARATOR);
require_once LIB_DIR . '/propel/runtime/lib/Propel.php';
try {
    \Propel::init(ENTITIES_DIR . 'build' . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . PROJECT_NAME . '-conf.php');
    \Propel::getDB()->setCharset(\Propel::getConnection(), 'UTF8');
    \Transaction::initAmounts(Config::get('amounts', TYPE_ARRAY), Config::get('member_fee', TYPE_FLOAT), Config::get('base_currency'));
} catch (\Exception $e) {
    // Do NOT output stacktrace because it holds the plain pg password.
    echo $e->getMessage();
    error_log($e->__toString());
    exit;
}
Exemplo n.º 13
0
<?php

require_once $GLOBALS['g_campsiteDir'] . "/conf/configuration.php";
require_once $GLOBALS['g_campsiteDir'] . "/classes/Input.php";
camp_load_translation_strings("localizer");
require_once dirname(__FILE__) . '/Localizer.php';
if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}
// Check permissions
if (!$g_user->hasPermission('ManageLocalizer')) {
    camp_html_display_error(getGS("You do not have the right to manage the localizer."));
    exit;
}
$prefix = Input::Get('prefix', 'string', '', true);
$unusedStrings = Localizer::FindUnusedStrings($prefix);
if (count($unusedStrings) > 0) {
    Localizer::RemoveString($prefix, $unusedStrings);
}
header("Location: /{$ADMIN}/localizer/index.php");
exit;
Exemplo n.º 14
0
 /**
  * Gets the error messages from the language file
  *
  * @param int $intCode
  * @param array $arrOptions
  */
 public function getErrorMessage($intCode, $arrOptions = array())
 {
     if (isset($arrOptions['error'])) {
         return $arrOptions['error'];
     }
     if (isset($arrOptions['message'])) {
         return $this->locale->insert($arrOptions['message'], array('value' => isset($arrOptions['value']) ? $arrOptions['value'] : $arrOptions['field'], 'field' => $arrOptions['field']));
     }
     switch ($intCode) {
         case FILTER_VALIDATE_REQUIRED:
             return $this->locale->insert('error.empty', array('value' => $arrOptions['field']));
         case FILTER_VALIDATE_PASSWORD:
             return $this->locale->get('error.password');
         case FILTER_VALIDATE_USERNAME:
             return $this->locale->insert('error.username', array('value' => '"' . $arrOptions['value'] . '"'));
         case FILTER_VALIDATE_IDENTIFIER:
             return $this->locale->insert('error.identifier', array('value' => '"' . $arrOptions['value'] . '"'));
         case FILTER_VALIDATE_RESOURCE:
             return $this->locale->insert('error.resource', array('value' => '"' . $arrOptions['value'] . '"'));
         case FILTER_VALIDATE_EMAIL:
             return $this->locale->insert('error.not_a_address', array('value' => '"' . $arrOptions['value'] . '"', 'type' => 'E-mail'));
         case FILTER_VALIDATE_IPV4:
             return $this->locale->insert('error.not_a_address', array('value' => '"' . $arrOptions['value'] . '"', 'type' => 'IPv4'));
         case FILTER_VALIDATE_IPV6:
             return $this->locale->insert('error.not_a_address', array('value' => '"' . $arrOptions['value'] . '"', 'type' => 'IPv6'));
         case FILTER_VALIDATE_IP:
             return $this->locale->insert('error.not_a_address', array('value' => '"' . $arrOptions['value'] . '"', 'type' => 'IP'));
         case FILTER_VALIDATE_URL:
             return $this->locale->insert('error.not_a_url', array('value' => $arrOptions['value']));
         case FILTER_VALIDATE_FLOAT:
             return $this->locale->insert('error.not_a_number', array('value' => $arrOptions['field']));
         case FILTER_VALIDATE_INT:
             if (isset($arrOptions['min_range']) && isset($arrOptions['max_range'])) {
                 return $this->locale->insert('error.in_between', array('value' => $arrOptions['field'], 'min' => $arrOptions['min_range'], 'max' => $arrOptions['max_range']));
             } elseif (isset($arrOptions['min_range'])) {
                 return $this->locale->insert('error.greater_than', array('value' => $arrOptions['field'], 'count' => $arrOptions['min_range']));
             } elseif (isset($arrOptions['max_range'])) {
                 return $this->locale->insert('error.less_than', array('value' => $arrOptions['field'], 'count' => $arrOptions['max_range']));
             } else {
                 return $this->locale->insert('error.not_a_int', array('value' => $arrOptions['field']));
             }
         case FILTER_VALIDATE_BOOLEAN:
             break;
         case FILTER_VALIDATE_MIN_LENGTH:
             return $this->locale->insert('error.too_short', array('value' => $arrOptions['field'], 'count' => $arrOptions['len']));
         case FILTER_VALIDATE_MAX_LENGTH:
             return $this->locale->insert('error.too_long', array('value' => $arrOptions['field'], 'count' => $arrOptions['len']));
         case FILTER_VALIDATE_LENGTH:
             return $this->locale->insert('error.wrong_range', array('value' => $arrOptions['field'], 'min' => $arrOptions['min'], 'max' => $arrOptions['max']));
         case FILTER_VALIDATE_DATE_RANGE:
             $arrOptions['format'] = isset($arrOptions['format']) ? $arrOptions['format'] : $this->locale->getDateFormat('date.format.default');
             return $this->locale->insert('error.date_range', array('value' => $arrOptions['field'], 'min' => date($arrOptions['format'], $arrOptions['min']), 'max' => date($arrOptions['format'], $arrOptions['max'])));
         case FILTER_VALIDATE_DATE_START_END:
             $arrOptions['format'] = isset($arrOptions['format']) ? $arrOptions['format'] : $this->locale->getDateFormat('date.format.default');
             return $this->locale->insert('error.date_start_end', array('value' => $arrOptions['field'], 'end' => date($arrOptions['format'], $arrOptions['end'])));
         default:
             // too_long
             // too_short
             // empty (Muss ausgefüllt werden)
             // invalid
             // start_before_end
             // range: Ist keine gültige {model}
             break;
     }
     return $this->locale->insert('error.invalid', array('value' => isset($arrOptions['value']) ? $arrOptions['value'] : $arrOptions['field'], 'field' => $arrOptions['field']));
 }
    function content_4f5d2c4be8f95($_smarty_tpl)
    {
        ?>
 <script>        
        function createUploader(){            
            var uploader = new qq.FileUploaderBasic({
            	element: document.getElementById('file-upload'),
                button:document.getElementById('file-upload'),
                name: 'ifiles',
                params: {
        			id_user: '******'id_usuario']->value;
        ?>
'
    			},
    			multiple: true,
                allowedExtensions: ['docx','ppt','pptx','bmp','psd','dmg',"txt","csv","xml",'css','doc','xls','rtf','pdf','swf','flv','avi','wmv','mov','jpg','jpeg','gif','png','zip','rar'],
                sizeLimit: 419430400, // max size   
				minSizeLimit: 0, // min size
 				onProgress: function(id, filename, loaded, total) {
 					 $('.qq-upload-list').hide();
 					$("#progressbar").css('display','block'); 
                    console.log('Progress for file: %s, ID: %s, loaded: %s, total: %s => %s', id, filename, loaded, total, "divID");
                    var percent = Math.round((loaded / total) * 100);
                     $("#progressbar").progressbar({ value: percent });
                    $('#message_progress').html('Uploading: ' + filename + ', ' + percent + '%' + ' (' + loaded + '/' + total + ')');
                    $('#upload_progress').show('slow');
                    
                },
                onComplete: function(id, filename, responseJSON) {
                    console.log('File upload for file %s, id %s done with status %s => %s', filename, id, responseJSON, "divID");
                    $('#upload_success').toggle();
                    //$('#upload_progress').hide();
                    $('#message_success').html( 'Finished: ' + filename);
                    $("#progressbar").css('display','none');
                  	$('#upload_success').delay(4000).fadeOut(400);
                  	$('#upload_progress').delay(4000).fadeOut(400);

                },
                onSubmit: function(id, fileName){
                	 $(".qq-upload-list").empty();
                	 $("#progressbar").css('display','block');
                	  $("#progressbar").progressbar({ value: 0 });
	             	 //$('#file-upload').addClass("loading");
	             },
                action: '<?php 
        echo $_smarty_tpl->tpl_vars['RUTA_WEB_ABSOLUTA']->value;
        ?>
user/upload/files',
                debug: true
            });           
        }
        
        // in your app create uploader as soon as the DOM is ready
        // don't wait for the window to load  
        window.onload = createUploader;     
    </script>   
<script type="text/javascript">
			var tx_titulo_display ='<?php 
        echo $_smarty_tpl->tpl_vars['tx_titulo_display']->value;
        ?>
';
			
			
			function setBlankHash2() {
			     	if (location.href.indexOf("#") > -1) {
			     		location.hash ='' + location.hash ;
					    location.assign(location.href.replace(/\/?#/, "/"));
					}

			}
			function cambiarUrl(url){
				location.hash = url;
				//parent.location.hash =   url_parent+url;
			}
			
	

			function createFolder(titulo){
				$('#titulo_archivo').html(titulo);
				
			 	$('#modal-from-dom').modal({
				   show : true,
				   keyboard : true,
				   backdrop : true
				});
			}
			function displaySettingsFolder(titulo, id, nombre, descripcion){
			 	$('#modal_edit_'+id).modal({
				   show: true, 
				   backdrop : true, 
				   keyboard: true
				});
				
				$('#titulo_archivo_'+id).html(titulo);
				$('#nombre_'+id).val(nombre);
				$('#descripcion_'+id).html(descripcion);
				
			}
			
			function cambiarBotonCrear(){
				$("#baceptar").removeClass("azul");
				$("#baceptar").addClass("gris");
				$("#baceptar").attr("value","loading...");
				$("#baceptar").attr('disabled', 'disabled');
				$("#id_cargando").toggle();
				$("#loading").toggle();
				$("#mensaje").css("display","none");
			}
			
			function cambiarBotonEditar(id){
				$("#bedit_"+id).removeClass("azul");
				$("#bedit_"+id).addClass("gris");
				$("#bedit_"+id).attr("value","loading...");
				$("#bedit_"+id).attr('disabled', 'disabled');
				$("#id_cargando").toggle();
				$("#loading").toggle();
				$("#mensaje").css("display","none");
			}
			
			$(document).ready( function() {
				setBlankHash2();
				// Show menu when #myDiv is clicked
				$("#myDiv").contextMenu({
					menu: 'myMenu'
				},
					function(action, el, pos) {
					/*alert(
						'Action: ' + action + '\n\n' +
						'Element ID: ' + $(el).attr('id') + '\n\n' + 
						'X: ' + pos.x + '  Y: ' + pos.y + ' (relative to element)\n\n' + 
						'X: ' + pos.docX + '  Y: ' + pos.docY+ ' (relative to document)'
						);*/
				});
				
				$("#myDivFile").contextMenu({
					menu: 'myMenuFile'
				},
					function(action, el, pos) {
					/*alert(
						'Action: ' + action + '\n\n' +
						'Element ID: ' + $(el).attr('id') + '\n\n' + 
						'X: ' + pos.x + '  Y: ' + pos.y + ' (relative to element)\n\n' + 
						'X: ' + pos.docX + '  Y: ' + pos.docY+ ' (relative to document)'
						);*/
				});
				
				// Show menu when a list item is clicked
				$("#myList TR TD").contextMenu({
					menu: 'myMenu'
				}, function(action, el, pos) {
				});
				
				
				// Show menu when a list item is clicked
				$("#myListFile TR TD").contextMenu({
					menu: 'myMenuFile'
				}, function(action, el, pos) {
				});
				
				
				
				$("#header").contextMenu({
					menu: 'myMenuOption'
				},
					function(action, el, pos) {
				});		
				
			});
			
			
			
			
$(document).ready(function() {
    // Validación del formulario.
    var_requerido_nombre = "<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_requerido_nombre_carpeta<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
";
    var validator = $("#form_crear_carpeta").validate({
        rules: {
    		nombre: {
				required: true,
				minlength: 4
			}
        },
        messages: {
        	nombre: {
				required: var_requerido_nombre ,
				minlength: ""
			}
        },
//        // Función aplicada cuando se produce un error de validación en el elemento pasado como parámetro.
//		// Se pasa también como como parámetro un array con un objeto html error, error[0].
//        errorPlacement: function(error, element) {
//			// Concatenamos el siguiente hijo del padre del elemnto el array de errores.
//			// En nuestro caso abajo en el formulario serían los <div> vacíos.
//			error.appendTo(element.parent().next());
//        },
        // Especifimos que hará el submir cuando el formulario sea válido, está función anulará el action definido en el formulario.
        submitHandler: function() {
			// Codificamos la clave.
			cambiarBotonCrear();
			// Inicamos la petición.
	        $.ajax({
	            type: 'POST',
	            url: '<?php 
        echo $_smarty_tpl->tpl_vars['RUTA_WEB_ABSOLUTA']->value;
        ?>
user/files/create',
	            data: $('#form_crear_carpeta').serialize(),
	            // before: mostrarVentanaCargando(),
	            // complete: ocultarVentanaCargando(), 
	            success: function(data) {
		        	var result = jQuery.parseJSON(data);
		      	  	if (result[1]==1){
			      	  	$('#retorno_usuario').html(result[0]);
						$('#mensaje').css('display','block');
						$('#error').addClass('error');
						$('#error').removeClass('success');
						$('#mensaje').delay(4000).fadeOut(400);
						$("#nombre").val("");
						$("#baceptar").removeClass("gris");
						$("#baceptar").addClass("azul");
						$("#baceptar").removeAttr("disabled");
						$('#modal-from-dom').modal('hide');
						$("#id_cargando").hide("slow");
						$("#baceptar").attr("value","Aceptar");
						$("#loading").toggle();
						$('#loading').delay(2000).fadeOut(400);
						
		      	  }else if (result[1]==2){
			      		$('#retorno_usuario').html(result[0]);
						$('#mensaje').css('display','block');
						$('#error').addClass('success');
						$('#error').removeClass('error');
						$('#mensaje').delay(4000).fadeOut(400);
						$("#nombre").val("");
						$("#baceptar").removeClass("gris");
						$("#baceptar").addClass("azul");
						$("#baceptar").removeAttr("disabled");
						$("#id_cargando").hide("slow");
						$('#modal-from-dom').modal('hide');
						$("#baceptar").attr("value","Aceptar");
						$("#loading").toggle();
						$('#loading').delay(2000).fadeOut(400);
						$('#row_file').html(result[2]);
			      	  }

					
	            }
	        });
        }
    });
    
    
	

    
   			   	

    
    
});	


</script>





<div id="div_inicio" style="margin-top:130px;width:98%;margin-bottom:50px;">
	<div id="mensaje" style="display:none">
		<div id="error" class="alert-message">
		    <p id="retorno_usuario"></p>
    	</div>
	</div>
	<div id="file-uploader">       
   	 <noscript>          
   	     <p>Please enable JavaScript to use file uploader.</p>
   	     <!-- or put a simple form for upload here -->
   	 </noscript>         
	</div>
	<?php 
        if (isset($_smarty_tpl->tpl_vars['aFile']->value) && $_smarty_tpl->tpl_vars['aFile']->value == '') {
            ?>
	<div class="alert-message block-message warning">
        <p><strong><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_init_message<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</strong> <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_init_message2<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</p>
        <div class="alert-actions">
          <a id="bnew" onclick="createFolder('<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_create_new_folder<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
');" href="#" class="btn small">
          	<img style="width:20px;vertical-align:bottom" src="<?php 
            echo $_smarty_tpl->tpl_vars['BASE_THEMES_URL']->value;
            ?>
images/icons/icon_button_folder.png"/><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_new_folder<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

          </a> 
          
          <a href="#" class="btn small">
          	<img style="width:20px;vertical-align:bottom" src="<?php 
            echo $_smarty_tpl->tpl_vars['BASE_THEMES_URL']->value;
            ?>
images/icons/icon_button_upload.png"/><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_upload_file<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

          </a>
        </div>
      </div>
      <?php 
        } else {
            ?>
     
		
		<div id="myList" class="drop_zone">
			<table style="float:left;" class="zebra-striped">
				<tbody >	
						<?php 
            echo $_smarty_tpl->getSubTemplate('files/row_success.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
            ?>

						<div id="row_file">
							<?php 
            echo $_smarty_tpl->getSubTemplate('files/row_file.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
            ?>

						</div>
				</tbody>
			</table>
		</div>
		 
		 
		 
		<ul id="myMenu" class="contextMenu">
			<li class="new"><a href="#open"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_open<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="open separator"><a href="#new_tab"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_new_tabs<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="upload"><a href="#submit_file"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_upload_fold<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="settings separator"><a href="#settings_folder"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_setting_fold<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="delete"><a href="#submit_file"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_delete_fold<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
		</ul>
		
		<ul id="myMenuOption" class="contextMenu">
			<li class="folder"><a onclick="createFolder('<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_create_new_folder<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
');" href="#"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_new_folder<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="upload"><a href="#file"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_upload_file<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
		</ul>
		
		<ul id="myMenuFile" class="contextMenu">
			<li class="preview"><a href="#preview"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_preview<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="download separator"><a href="#download"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_new_download_file<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="upload"><a href="#upload"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_upload_file<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="share separator"><a href="#share"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_share<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="tags"><a href="#tags"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_tags<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="settings separator"><a href="#properties"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_setting_files<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="copy"><a href="#move_copy"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_move_copy<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
			<li class="delete"><a href="#delete_file"><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
tx_options_delete_file<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</a></li>
		</ul>
	
		<?php 
        }
        ?>
	<!-- The Modal Dialog  Para mostrar mensaje-->
	  <div id="modal-from-dom" class="modal hide fade" style="width:500px;">
	  	<form  method="post" id="form_crear_carpeta" name="form_crear_carpeta" class="form_mensaje">
		    <div class="modal-header">
		    	<img style="vertical-align:bottom" src="<?php 
        echo $_smarty_tpl->tpl_vars['config_urls']->value['IMAGES_THEMES_URL'];
        ?>
icons/icon_folder.png"/>
			    <span style="font-size:22px;color:#525252;font-weight: bold;" id="titulo_archivo"></span>
			    <a href="#" class="close">&times;</a><br/>
		    </div>
		    <div class="modal-body">
		    	<div id="mensaje" style="display:none">
					<div id="error" class="alert-message">
					    <p id="retorno_usuario"></p>
				    </div>
			 	</div>
		    	<h4 style="color: #666666"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_form_name<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
:</h4>
				<input type="text" class="span8 required" id="nombre" name="nombre" placeholder="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_form_name_placeholder<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
">
		      <p id="textoobj"></p>
		    </div>
		    <div class="modal-footer" style="text-align:center;">
		    	<input type="hidden" name="id_usuario" id="id_usuario" value="<?php 
        echo $_smarty_tpl->tpl_vars['id_usuario']->value;
        ?>
"/> 
		    	
				<input type="submit" id="baceptar" name="baceptar" value="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_button_accept<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
" class="btn small bold azul"/>
				<input type="button" href="#" class="btn small close bold azul" style="margin-top: 0px;opacity: 1;float:none" value="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_button_cancel<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
" />
				
	  		</div>
  		</form>
	  </div>
	  
	
</div>
<?php 
    }
Exemplo n.º 16
0
	/**
	 * Delete the language, this will also delete the language files unless
	 * the parameter specifies otherwise.
	 *
	 * @return boolean
	 */
	public function delete($p_deleteLanguageFiles = true)
	{
		if (is_link($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php')) {
			unlink($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php');
		}
		if ($p_deleteLanguageFiles) {
			$result = Localizer::DeleteLanguageFiles($this->getCode());
			if (PEAR::isError($result)) {
				return result;
			}
		}
		$tmpData = $this->m_data;
		$success = parent::delete();
		if ($success) {
		        CampCache::singleton()->clear('user');
			if (function_exists("camp_load_translation_strings")) {
				camp_load_translation_strings("api");
			}
			$logtext = getGS('Language "$1" ($2) deleted', $tmpData['Name'], $tmpData['OrigName']);
			Log::Message($logtext, null, 102);
		}
		return $success;
	} // fn delete
    function content_4f5d2cc18a8c5($_smarty_tpl)
    {
        ?>
<div class="main spacer">
	<ul>
		<li style="margin-bottom:10px;">
			<a href="<?php 
        echo $_smarty_tpl->tpl_vars['BASE_URL']->value;
        ?>
preguntas-frecuentes.html" title="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_faq<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 - uptobox.net"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_faq<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</a> | <a href="<?php 
        echo $_smarty_tpl->tpl_vars['BASE_URL']->value;
        ?>
trabaja-con-nosotros.html" title="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_how<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 - uptobox.net"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_how<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</a> | <a href="<?php 
        echo $_smarty_tpl->tpl_vars['BASE_URL']->value;
        ?>
contacto.html" title="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_contact<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 - uptobox.net"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_contact<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</a> | <a href="<?php 
        echo $_smarty_tpl->tpl_vars['BASE_URL']->value;
        ?>
aviso-legal.html" title="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_privacy<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 - uptobox.net"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_privacy<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</a> | <a href="<?php 
        echo $_smarty_tpl->tpl_vars['BASE_URL']->value;
        ?>
politica-privacidad.html" title="<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_term<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 - uptobox.net"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_term<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</a>
		</li>
        <li>Copyright 2011 - uptobox.net - <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_right<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
.</li>
   	</ul>
   	<div style="float: left;" >
   		<br /><br /><a href="http://www.aleatechnology.es" target="_blank" style="font-weight: bold; color: #63676c;" title="Alea Technology"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_developer<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_footer_company<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</a>
    </div>
   	<div style="float: right;" >
		<img alt="uptobox.net" src="<?php 
        echo $_smarty_tpl->tpl_vars['BASE_URL']->value;
        ?>
images/logos/logo_grande.png">
	</div>
</div><?php 
    }
Exemplo n.º 18
0
 /**
  * @since 2.5
  *
  * @param string $id
  * @param string|null $languageCode
  *
  * @return string
  */
 public function findPreferredPropertyLabelById($id, $languageCode = '')
 {
     if ($languageCode === false || $languageCode === '') {
         $languageCode = Localizer::getInstance()->getUserLanguage()->getCode();
     }
     return $this->propertyLabelFinder->findPreferredPropertyLabelByLanguageCode($id, $languageCode);
 }
Exemplo n.º 19
0
<?php

require_once $GLOBALS['g_campsiteDir'] . "/conf/configuration.php";
require_once $GLOBALS['g_campsiteDir'] . "/classes/Input.php";
camp_load_translation_strings("localizer");
require_once dirname(__FILE__) . '/Localizer.php';
if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}
// Check permissions
if (!$g_user->hasPermission('ManageLocalizer')) {
    camp_html_display_error(getGS("You do not have the right to manage the localizer."));
    exit;
}
$prefix = Input::Get('prefix', 'string', '', true);
$newPrefix = Input::Get('new_prefix');
$moveStr = Input::Get('string');
Localizer::ChangeStringPrefix($prefix, $newPrefix, $moveStr);
header("Location: /{$ADMIN}/localizer/index.php");
exit;
 /**
  * create the personal options options form, using the {@link TableEditor}
  * 
  * {@link TableEditor} is able to handle saving of the data himself
  * @uses TableEditor
  * @return string html-content
  * @global array country acronyms and names
  * @global DB used for database access
  */
 function createOptionsForm()
 {
     global $country, $db;
     $cont = '<fieldset class="options-options">';
     $cont .= '<legend>Change your options</legend>';
     $tEdit = new TableEditor($db, TABLE_USERS, 'userid', array('id' => 'hidden', 'usertype' => 'hidden', 'password' => 'hidden', 'reg_email' => 'hidden', 'confirm_hash' => 'hidden', 'lastLogin' => 'hidden', 'limitEntries' => 'text-5', 'bdayDisplay' => array('NULL' => 'default', '0' => 'no', '1' => 'yes'), 'bdayInterval' => 'text-3', 'telURI' => 'text-30', 'faxURI' => 'text-30', 'language' => array_merge(array('NULL' => 'autodetect'), Localizer::getSingleton()->availableLanguages()), 'useMailScript' => 'hidden', 'failedLogins' => 'hidden', 'lastRemoteIP' => 'hidden'), array('limitEntries' => 'Main list: limit entries per page', 'bdayInterval' => 'Main list: display dates and recently changed contacts n days back', 'bdayDisplay' => 'Main list: display dates', 'telURI' => 'URI: Replace tel: (e.g. skype:$?call)', 'faxURI' => 'URI: Replace fax: (e.g. sip:$@sip.com:5060)', 'language' => 'User interface language', 'useMailScript' => 'Users can send email with a web interface from the server (not supported in 3.0)'), 'SELECT * FROM ' . TABLE_USERS . ' WHERE userid = ' . ($this->user !== null ? $db->escape($this->user->id) : $_SESSION['user']->id), 'text', true, $this->user !== null ? 'userid=' . $this->user->id : '');
     $cont .= $tEdit->create('', '');
     $cont .= '</fieldset>';
     return $cont;
 }
Exemplo n.º 21
0
 /**
  * Updates a property
  *
  * @param int $id The property ID
  * @param array $data
  * @return int The property ID
  */
 public function do_update($id, $data = null)
 {
     $user = $this->requireUser();
     if (!$user->isAdmin()) {
         throw new Exception('Only administrators are allowed to edit properties.');
     }
     // Validate input data
     $validator = new KickstartValidator();
     $locale = Localizer::getInstance();
     $warnings = $validator->filterErrors($data, $this->initFilter($this->filter_basic, $locale));
     if ($warnings) {
         return array('result' => false, 'warnings' => $warnings);
     }
     $query = PropertyQuery::create()->filterByAccount($user->getAccount());
     if ($id !== null) {
         $query->filterById($id, Criteria::NOT_EQUAL);
         $property = PropertyQuery::create()->filterByAccount($user->getAccount())->findOneById($id);
         if (!$property) {
             throw new Exception('Property not found; ID: ' . $id);
         }
     } else {
         $property = new Property();
     }
     // Check for duplicates
     if (isset($data['Name']) and $query->findOneByName($data['Name'])) {
         throw new Exception($locale->insert('error.taken', array('value' => '"' . $data['Name'] . '"')));
     }
     unset($data['Id']);
     $property->fromArray($data);
     $property->setAccount($user->getAccount());
     $property->save();
     return $property->getId();
 }
Exemplo n.º 22
0
/**
 * Creates a form for translation.
 * @param array $p_request
 */
function translationForm($p_request)
{
    global $g_localizerConfig;
	$localizerTargetLanguage = camp_session_get('localizer_target_language', $g_localizerConfig['DEFAULT_LANGUAGE']);
	$localizerSourceLanguage = camp_session_get('localizer_source_language', '');
	if (empty($localizerSourceLanguage)) {
		if (isset($p_request['TOL_Language'])) {
			$lang = $p_request['TOL_Language'];
		} else {
			$lang = $g_localizerConfig['DEFAULT_LANGUAGE'];
		}
		$tmpLanguage = new LocalizerLanguage(null, $lang);
		$localizerSourceLanguage = $tmpLanguage->getLanguageId();
	}

	$prefix = camp_session_get('prefix', '');
	$screenDropDownSelection = $prefix;

	// Load the language files.
	//echo "Prefix: $prefix<br>";
	$sourceLang = new LocalizerLanguage($prefix, $localizerSourceLanguage);
	$targetLang = new LocalizerLanguage($prefix, $localizerTargetLanguage);
	$defaultLang = new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);

	$mode = Localizer::GetMode();
	if (!empty($prefix)) {
    	// If the language files do not exist, create them.
        if (!$defaultLang->loadFile($mode)) {
        	$defaultLang->saveFile($mode);
        }
    	if (!$sourceLang->loadFile($mode)) {
    		$sourceLang->saveFile($mode);
    	}
    	if (!$targetLang->loadFile($mode)) {
    		$targetLang->saveFile($mode);
        }

        // Make sure that the languages have the same strings and are in the same
        // order as the default language file.
        $modified = $sourceLang->syncToDefault();
        if ($modified) {
        	$sourceSaveSuccess = $sourceLang->saveFile($mode);
        	camp_html_add_msg($sourceSaveSuccess);
        }
        $modified = $targetLang->syncToDefault();
        if ($modified) {
        	$targetSaveSuccess = $targetLang->saveFile($mode);
        	camp_html_add_msg($targetSaveSuccess);
        }
	}


    $defaultStrings = $defaultLang->getTranslationTable();
    $searchString = camp_session_get('search_string', '');
    if (!empty($searchString)) {
    	$sourceStrings = $sourceLang->search($searchString);
    }
    else {
    	$sourceStrings = $sourceLang->getTranslationTable();
    }
	$targetStrings = $targetLang->getTranslationTable();
	$languages = Localizer::GetAllLanguages($mode);


	$missingStrings = Localizer::FindMissingStrings($prefix);
	$unusedStrings = Localizer::FindUnusedStrings($prefix);

	// Mapping of language prefixes to human-readable strings.
    $mapPrefixToDisplay = array();
    $mapPrefixToDisplay[] = "";
    $mapPrefixToDisplay["globals"] = getGS("Globals");
    $mapPrefixToDisplay["home"] = getGS("Dashboard");
    $mapPrefixToDisplay["api"] = getGS("API");
    $mapPrefixToDisplay["library"] = getGS("Libraries");
    $mapPrefixToDisplay["pub"] = getGS("Publications");
    $mapPrefixToDisplay["issues"] = getGS("Issues");
    $mapPrefixToDisplay["sections"] = getGS("Sections");
    $mapPrefixToDisplay["articles"] = getGS("Articles");
    $mapPrefixToDisplay["article_images"] = getGS("Article Images");
    $mapPrefixToDisplay["article_files"] = getGS("Article Files");
    $mapPrefixToDisplay["article_topics"] = getGS("Article Topics");
    $mapPrefixToDisplay["article_comments"] = getGS("Article Comments");
    $mapPrefixToDisplay["media_archive"] = getGS("Media Archive");
    $mapPrefixToDisplay["geolocation"] = getGS("Geo-location");
    $mapPrefixToDisplay["comments"] = getGS("Comments");
    $mapPrefixToDisplay["system_pref"] = getGS("System Preferences");
    $mapPrefixToDisplay["templates"] = getGS("Templates");
    $mapPrefixToDisplay["article_types"] = getGS("Article Types");
    $mapPrefixToDisplay["article_type_fields"] = getGS("Article Type Fields");
    $mapPrefixToDisplay["topics"] = getGS("Topics");
    $mapPrefixToDisplay["languages"] = getGS("Languages");
    $mapPrefixToDisplay["country"] = getGS("Countries");
    $mapPrefixToDisplay["localizer"] = getGS("Localizer");
    $mapPrefixToDisplay["logs"] = getGS("Logs");
    $mapPrefixToDisplay["users"] = getGS("Users");
    $mapPrefixToDisplay["user_subscriptions"] = getGS("User Subscriptions");
    $mapPrefixToDisplay["user_subscription_sections"] = getGS("User Subscriptions Sections");
    $mapPrefixToDisplay["user_types"] = getGS("Staff User Types");
    $mapPrefixToDisplay["bug_reporting"] = getGS("Bug Reporting");
    $mapPrefixToDisplay["feedback"] = getGS("Feedback");
    $mapPrefixToDisplay["preview"] = getGS("Preview Window");
    $mapPrefixToDisplay["tiny_media_plugin"] = getGS("Editor Media Plugin");
    $mapPrefixToDisplay["plugins"] = getGS("Plugins");
    $mapPrefixToDisplay["extensions"] = getGS("Extensions");
    $mapPrefixToDisplay["authors"] = getGS("Authors");

    foreach (CampPlugin::GetPluginsInfo(true) as $info) {
    	if (array_key_exists('localizer', $info) && is_array($info['localizer'])) {
    		$mapPrefixToDisplay[$info['localizer']['id']] = getGS($info['localizer']['screen_name']);
    	}
    }

	// Whether to show translated strings or not.
	$hideTranslated = camp_session_get('hide_translated', 'off');

    camp_html_display_msgs();
	?>
	<table>
	<tr>
		<td valign="top"> <!-- Begin top control panel -->

        <form action="index.php" method="post">
		<?php echo SecurityToken::FormParameter(); ?>
        <input type="hidden" name="localizer_lang_id" value="<?php echo $targetLang->getLanguageId(); ?>">
        <input type="hidden" name="search_string" value="<?php echo htmlspecialchars($searchString); ?>">
		<table border="0" cellpadding="0" cellspacing="0" class="box_table">
		<tr>
			<td>
				<table>
				<tr>
					<td>
						<?php putGS('Area to localize'); ?>:
					</td>
				</tr>
				<tr>
					<td>
						<SELECT name="prefix" class="input_select" onchange="this.form.submit();">
						<?PHP
						foreach ($mapPrefixToDisplay as $prefix => $displayStr) {
						    if (!empty($prefix)) {
						        $transl_status[$prefix] = Localizer::GetTranslationStatus($prefix, $localizerTargetLanguage);
						    }
						    camp_html_select_option($prefix, $screenDropDownSelection, $displayStr, $transl_status[$prefix]['untranslated'] ? array('style' => 'color:red') : array());
						}
						?>
						</SELECT>
					</td>
				</tr>
				</table>
			</td>

			<td>
				<table>
				<tr>
					<td>
						<?php putGS('Translate from:'); ?>
					</td>
				</tr>
				<tr>
					<td>
		        		<SELECT NAME="localizer_source_language" onchange="this.form.submit();" class="input_select">
		        		<?php echo LanguageMenu($languages, $localizerSourceLanguage); ?>
		        		</select>
					</td>
				</tr>
				</table>
			</td>

			<td>
				<table>
				<tr>
					<td>
						<?php putGS('Translate to:'); ?>
					</td>
				</tr>
				<tr>
					<td>
				        <SELECT NAME="localizer_target_language" onChange="this.form.submit();" class="input_select">
				    	<?php echo LanguageMenu($languages, $localizerTargetLanguage); ?>
				        </select>
					</td>
				</tr>
				</table>
			</td>

			<td>
				<table>
				<tr>
					<td>
						<?php putGS('Translation status:'); ?>
					</td>
				</tr>
				<tr>
					<td>
				        <?php
				        if ($screenDropDownSelection) {
				            $all = $transl_status[$screenDropDownSelection]['all'];
				            $transl = $transl_status[$screenDropDownSelection]['translated'];
				            $untransl = $transl_status[$screenDropDownSelection]['untranslated'];
				        } else {
    				        foreach ($transl_status as $screen) {
    				            $all += $screen['all'];
    				            $transl += $screen['translated'];
    				            $untransl += $screen['untranslated'];
    				        }
				        }
				        if ($all) {
				            putGS("$1 of $2 strings translated", $transl, $all);
				            echo '<br>'.round(100 - 100 / $all * $untransl, 2) . ' %';
				        } else {
				            echo 'N/A';
				        }
				        ?>
					</td>
				</tr>
				</table>
			</td>

		</tr>
		<tr>
			<td align="center" colspan="4">
				<table>
				<tr>
					<td>
						<select name="hide_translated" onChange="this.form.submit();" class="input_select">
						<?php camp_html_select_option('off', $hideTranslated, getGS('Show translated strings')); ?>
						<?php camp_html_select_option('on', $hideTranslated, getGS('Hide translated strings')); ?>
						</select>
					</td>

					<td style="padding-left: 10px;">
						<INPUT type="submit" value="<?php putGS("Submit"); ?>" class="button">
					</td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
        </form>

		</td><!-- End top controls -->
	</tr>

	<!-- Begin search dialog -->
	<tr>
		<td valign="top">
            <form>
            <input type="hidden" name="prefix" value="<?php echo $screenDropDownSelection; ?>">
            <input type="hidden" name="localizer_source_language" value="<?php echo $sourceLang->getLanguageId(); ?>">
            <input type="hidden" name="localizer_target_language" value="<?php echo $targetLang->getLanguageId(); ?>">
			<table border="0" cellspacing="0" cellpadding="0" class="box_table">
			<tr>
				<td width="1%" style="padding-left: 5px;">
					<img src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/preview.png">
				</td>

				<td style="padding-left: 10px;">
					<input type="text" name="search_string" value="<?php echo $searchString; ?>" class="input_text" size="50">
				</td>

				<td width="1%" nowrap>
					<input type="button" value="<?php putGS("Search"); ?>" onclick="this.form.submit();" class="button">
				</td>
			</tr>
			</table>
            </form>
		</td>
	</tr>

	<!-- Begin Missing and Unused Strings popups -->
	<tr>
		<td valign="top">

	<?PHP
	if ((count($missingStrings) > 0)  && ($screenDropDownSelection != 'globals')) {
		?>
        <form action="do_add_missing_strings.php" method="post">
		<?php echo SecurityToken::FormParameter(); ?>
        <input type="hidden" name="prefix" value="<?php echo $screenDropDownSelection; ?>">
        <input type="hidden" name="localizer_source_language" value="<?php echo $sourceLang->getLanguageId(); ?>">
        <input type="hidden" name="localizer_target_language" value="<?php echo $targetLang->getLanguageId(); ?>">
        <table border="0" cellspacing="0" cellpadding="0" class="box_table">
		<tr>
			<td>
				<img src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/add.png">
			</td>

			<td>
				<?php putGS("The following strings are missing from the translation files:"); ?>
				<div style="overflow: auto; height: 50px; background-color: #EEEEEE; border: 1px solid black; padding-left: 3px;">
				<?PHP
				foreach ($missingStrings as $missingString) {
					echo htmlspecialchars($missingString)."<br>";
				}
				?>
				</div>
			</td>

			<td>
		        <input type="submit" value="<?php putGS("Add"); ?>" class="button">
			</td>
		</tr>
		</table>
        </form>
		<?php
	}

	if ((count($unusedStrings) > 0) && ($screenDropDownSelection != 'globals')) {
		?>
        <form action="do_delete_unused_strings.php" method="post">
		<?php echo SecurityToken::FormParameter(); ?>
        <input type="hidden" name="prefix" value="<?php echo $screenDropDownSelection; ?>">
        <input type="hidden" name="localizer_source_language" value="<?php echo $sourceLang->getLanguageId(); ?>">
        <input type="hidden" name="localizer_target_language" value="<?php echo $targetLang->getLanguageId(); ?>">
        <table border="0" cellspacing="0" cellpadding="0" class="box_table">
		<tr>
			<td>
				<img src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/delete.png">
			</td>

			<td>
				<?php putGS("The following strings are not used:"); ?>
				<div style="overflow: auto; height: 50px; background-color: #EEEEEE; border: 1px solid black; padding-left: 3px;">
				<?PHP
				foreach ($unusedStrings as $unusedString) {
					echo htmlspecialchars($unusedString)."<br>";
				}
				?>
				</div>
			</td>

			<td>
		        <input type="submit" value="<?php putGS("Delete"); ?>" class="button">
			</td>
		</tr>
		</table>
        </form>
		<?php
	}
	?>
	<!-- Begin translated strings box -->
    <form action="do_save.php" method="post">
	<?php echo SecurityToken::FormParameter(); ?>
    <INPUT TYPE="hidden" name="prefix" value="<?php echo $screenDropDownSelection; ?>">
    <INPUT TYPE="hidden" name="localizer_target_language" value="<?php echo $targetLang->getLanguageId(); ?>">
    <INPUT TYPE="hidden" name="localizer_source_language" value="<?php echo $sourceLang->getLanguageId(); ?>">
    <INPUT TYPE="hidden" name="search_string" value="<?php echo $searchString; ?>">
	<table border="0" cellpadding="0" cellspacing="0" class="box_table">
	<?PHP
	$foundUntranslatedString = false;
	$count = 0;
	foreach ($sourceStrings as $sourceKey => $sourceValue) {
	    if (!empty($targetStrings[$sourceKey])) {
	        $targetValueDisplay = str_replace('"', '&#34;', $targetStrings[$sourceKey]);
	        $targetValueDisplay = str_replace("\\", "\\\\", $targetValueDisplay);
	        $pre  = '';
	        $post = '';
	    } else {
	        $targetValueDisplay = '';
	        $pre    = '<FONT COLOR="red">';
	        $post   = '</FONT>';
	    }

		$sourceKeyDisplay = htmlspecialchars(str_replace("\\", "\\\\", $sourceKey));

		// Dont display translated strings
	    if ($hideTranslated == 'on' && !empty($targetStrings[$sourceKey])) {
	    	?>
	        <input name="data[<?php echo $count; ?>][key]" type="hidden" value="<?php echo $sourceKeyDisplay; ?>">
	        <input name="data[<?php echo $count; ?>][value]" type="hidden" value="<?php echo $targetValueDisplay; ?>">
	        <?php
	    }
	    else {
	    	// Display the interface for translating a string.

	    	$foundUntranslatedString = true;
	    	// Display string
	    	?>
	        <tr>
	        	<td style="padding-top: 7px;" width="500px">
				<?php
            	// If the string exists in the source language, display that
	            if (!empty($sourceValue)) {
	            	?>
	                <b><?php echo $sourceLang->getLanguageId(); ?>:</b> <?php echo $pre.htmlspecialchars(str_replace("\\", "\\\\", $sourceValue)).$post; ?>
	                <?php
	            }
	            // Otherwise, display it in the default language.
	            else {
	            	if (isset($defaultStrings[$sourceKey])) {
	            		$defaultValue = $defaultStrings[$sourceKey];
	            	} else {
	            		$defaultValue = '';
	            	}
	            	?>
	                <b><?php echo $g_localizerConfig['DEFAULT_LANGUAGE']; ?>:</b> <?php echo $pre.$defaultValue.$post; ?>
	                <?php
	            }
				?>
				</td>
			</tr>
			<tr>
				<td>
			        <input name="data[<?php echo $count; ?>][key]" type="hidden" value="<?php echo $sourceKeyDisplay; ?>">
			        <table cellpadding="0" cellspacing="0">
			        <tr>
			             <td style="padding-right: 5px;">
					       <input type="image" src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/save.png" name="save" value="save">
					     </td>
					     <td>
			                 <input name="data[<?php echo $count; ?>][value]" type="text" size="<?php echo $g_localizerConfig['INPUT_SIZE']; ?>" value="<?php echo $targetValueDisplay; ?>" class="input_text">
			             </td>

			   			<?php
            			// default language => can change keys
            	        if ($targetLang->getLanguageId() == $g_localizerConfig['DEFAULT_LANGUAGE']) {
            	            $fileparms = "localizer_target_language=".$targetLang->getLanguageId()
            	           		."&localizer_source_language=".$sourceLang->getLanguageId()
            	            	."&prefix=".urlencode($screenDropDownSelection)
            	            	."&search_string=".urlencode($searchString);

            	            if ($count == 0) {
            	            	// swap last and first entry
            	                $prev = count($sourceStrings)-1;
            	                $next = $count+1;
            	            }
            	            elseif ($count == count($sourceStrings)-1) {
            	            	// swap last and first entry
            	                $prev = $count-1;
            	                $next = 0;
            	            }
            	            else {
            	            	// swap entrys linear
            	            	$prev = $count-1;
            	            	$next = $count+1;
            	            }

            	            $removeLink    = "do_delete_string.php?pos=$count&$fileparms"
            	            	."&string=".urlencode($sourceKey).'&'.SecurityToken::URLParameter();
            	            $moveUpLink    = "do_reorder_string.php?pos1=$count&pos2=$prev&$fileparms&".SecurityToken::URLParameter();
            	            $moveDownLink  = "do_reorder_string.php?pos1=$count&pos2=$next&$fileparms&".SecurityToken::URLParameter();
                			if (empty($searchString)) {
            				?>
            				<td style="padding-left: 3px;">
            	            <a href="<?php echo $moveUpLink; ?>"><img src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/up.png" border="0"></a>
            	            </td>
            	           	<td style="padding-left: 3px;">
            	            <a href="<?php echo $moveDownLink; ?>"><img src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/down.png" border="0"></a>
                   	        </td>
                   	        <?php
            	            }
            	            ?>
            	            <td style="padding-left: 3px;">
            	            <a href="<?php echo $removeLink; ?>" onClick="return confirm('<?php putGS('Are you sure you want to delete this entry?'); ?>');"><img src="<?php echo $g_localizerConfig['ICONS_DIR']; ?>/delete.png" border="0" vspace="4"></a>
            	            </td>

            	            <td style="padding-left: 5px;" nowrap>
								<SELECT name="change_prefix_<?php echo $count; ?>" class="input_select">
								<?PHP
								foreach ($mapPrefixToDisplay as $prefix => $displayStr) {
									if ($prefix != $screenDropDownSelection) {
										camp_html_select_option($prefix, null, $displayStr);
									}
								}
								?>
								</SELECT>
								<input type="button" name="" value="Move" onclick="location.href='do_string_switch_file.php?string=<?php echo urlencode($sourceKey); ?>&new_prefix='+this.form.change_prefix_<?php echo $count; ?>.options[this.form.change_prefix_<?php echo $count; ?>.selectedIndex].value+'&<?php echo $fileparms; ?>&<?php echo SecurityToken::URLParameter(); ?>';" class="button">
            	            </td>
                            <?php
                	        }
                			?>
			         </tr>
			         </table>
		        </td>

				</tr>
	        <?php
	    }
	    $count++;
	}
	if (count($sourceStrings) <= 0) {
		if (empty($searchString)) {
			?>
			<tr><td align="center" style="padding-top: 10px; font-weight: bold;"><?php putGS("No source strings found.");?> </td></tr>
			<?php
		}
		else {
			?>
			<tr><td align="center" style="padding-top: 10px; font-weight: bold;"><?php putGS("No matches found.");?> </td></tr>
			<?php
		}
	}
	elseif (!$foundUntranslatedString) {
		if (empty($searchString)) {
			?>
			<tr><td align="center" style="padding-top: 10px; font-weight: bold;"><?php putGS("All strings have been translated."); ?></td></tr>
			<?php
		}
		else {
			?>
			<tr><td align="center" style="padding-top: 10px; font-weight: bold;"><?php putGS("No matches found.");?> </td></tr>
			<?php
		}
	}
	?>
	</table>

	<table style="margin-left: 12px; margin-top: 5px;">
	<tr>
		<td>
			<input type="submit" name="save_button" value="<?php putGS('Save'); ?>" class="button">
		</td>
	</tr>
	</table>
	</form>

		</td> <!-- End translate strings box -->
	</tr>
	</table>
	<?php
} // fn translationForm
    function content_4f5d2b71116f3($_smarty_tpl)
    {
        ?>
		<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['aModuleStyles']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
			<?php 
            echo $_smarty_tpl->tpl_vars['item']->value;
            ?>

		<?php 
        }
        ?>
		
			<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['aModuleScripts']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            ?>
				<script language="JavaScript" src='<?php 
            echo $_smarty_tpl->tpl_vars['item']->value;
            ?>
'></script>
			<?php 
        }
        ?>
			
			<script  language="JavaScript">
				
					var var_requerido_usuario =  "<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
tx_requerido_usuario<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
" ;
					var var_requerido_password =  "******" ;
					
					$(document).ready(function() {
					    // Validación del formulario.
					    var validator = $("#form_login").validate({
					        rules: {
					    		username: {
									required: true,
									minlength: 4
								},
								password: {
									required: true
								}
					        },
					        messages: {
					        	username: {
									required: var_requerido_usuario ,
									minlength: ""
								},
								password: {
									required: var_requerido_password,
									minlength: ""
								}
					        },
					//        // Función aplicada cuando se produce un error de validación en el elemento pasado como parámetro.
					//		// Se pasa también como como parámetro un array con un objeto html error, error[0].
					//        errorPlacement: function(error, element) {
					//			// Concatenamos el siguiente hijo del padre del elemnto el array de errores.
					//			// En nuestro caso abajo en el formulario serían los <div> vacíos.
					//			error.appendTo(element.parent().next());
					//        },
					        // Especifimos que hará el submir cuando el formulario sea válido, está función anulará el action definido en el formulario.
					        submitHandler: function() {
								// Codificamos la clave.
								cambiarBotonLogin();
								// Inicamos la petición.
						        $.ajax({
						            type: 'POST',
						            url: '<?php 
        echo $_smarty_tpl->tpl_vars['RUTA_WEB_ABSOLUTA']->value;
        ?>
login/verificate',
						            data: $('#form_login').serialize(),
						            // before: mostrarVentanaCargando(),
						            // complete: ocultarVentanaCargando(), 
						            success: function(data) {
							        	var result = jQuery.parseJSON(data);
							      	  	if (result[1]==1){
								      	  	$('#retorno_usuario_error').css('display','block');
								      	  	$('#retorno_usuario').css('display','none');
											$('#mensaje').css('display','block');
											$('#error').addClass('error');
											$('#error').removeClass('success');
											$('#mensaje').delay(4000).fadeOut(400);
											$("#password").val("");
											$("#blogin").removeClass("gris");
											$("#blogin").addClass("azul");
											$("#blogin").removeAttr("disabled");
											$("#id_cargando").hide("slow");
											
							      	  	}else if (result[1]==2){
							      	  		$('#retorno_usuario').css('display','block');
							      	  		$('#retorno_usuario_error').css('display','none');
											$('#mensaje').css('display','block');
											$('#error').addClass('success');
											$('#error').removeClass('error');
											$('#mensaje').delay(4000).fadeOut(400);
											$("#password").val("");
											$("#blogin").removeClass("gris");
											$("#blogin").addClass("azul");
											$("#blogin").removeAttr("disabled");
											$("#id_cargando").hide("slow");
											window.location.replace("<?php 
        echo $_smarty_tpl->tpl_vars['RUTA_WEB_ABSOLUTA']->value;
        ?>
admin");
							      	  }else if (result[1]==3){
								      		$('#retorno_usuario').css('display','block');
								      		$('#retorno_usuario_error').css('display','none');
											$('#mensaje').css('display','block');
											$('#error').addClass('success');
											$('#error').removeClass('error');
											$('#mensaje').delay(4000).fadeOut(400);
											$("#password").val("");
											$("#blogin").removeClass("gris");
											$("#blogin").addClass("azul");
											$("#blogin").removeAttr("disabled");
											$("#id_cargando").hide("slow");
											window.location.replace("<?php 
        echo $_smarty_tpl->tpl_vars['RUTA_WEB_ABSOLUTA']->value;
        ?>
user/files");
								      	  }
					
										
						            }
						        });
					        }
					    });
					});	


			</script>
			
			
		

	     
					        	<!-- Modal -->
					              <form name="<?php 
        echo $_smarty_tpl->tpl_vars['datas']->value['name'];
        ?>
" id="<?php 
        echo $_smarty_tpl->tpl_vars['datas']->value['id'];
        ?>
" <?php 
        if (!$_smarty_tpl->tpl_vars['is_jquery']->value) {
            ?>
 action="<?php 
            echo $_smarty_tpl->tpl_vars['datas']->value['action'];
            ?>
" <?php 
        }
        ?>
 method="<?php 
        echo $_smarty_tpl->tpl_vars['datas']->value['method'];
        ?>
">
					              			<div style="width:90%;position: relative; top: auto; left: auto; margin:0 auto;margin-top:-41px;margin-left:100px; z-index: 1" class="modal">
								        	  <div class="modal-header">
								            		<h3><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
        $_block_repeat = true;
        echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
name<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
</h3>
								              </div>
								        	  <div class="modal-body">
								        	  			<?php 
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['datas']->value['fields'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
            ?>
										          	  		<h4><?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                echo $_smarty_tpl->tpl_vars['item']->value;
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
</h4>
										          	  		<input type="<?php 
            echo $_smarty_tpl->tpl_vars['datas']->value['type'][$_smarty_tpl->tpl_vars['item']->value];
            ?>
" placeholder="<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('translate', array());
            $_block_repeat = true;
            echo Localizer::translate(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                echo $_smarty_tpl->tpl_vars['item']->value;
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo Localizer::translate(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>
" name="<?php 
            echo $_smarty_tpl->tpl_vars['item']->value;
            ?>
" id="<?php 
            echo $_smarty_tpl->tpl_vars['item']->value;
            ?>
" class="xlarge required" />
										          	  		<br/><br/>
										          	  	<?php 
        }
        ?>
											 </div>
								        	  <div class="modal-footer">
								        	  	<input type="hidden" value="1" name="action"/>	
								        	  	<img id="id_cargando" style="display:none" src="<?php 
        echo $_smarty_tpl->tpl_vars['PATH']->value;
        ?>
img/loading.gif" />
								        	    <input tabindex="3" type="submit" class="btn primary" style="float: right;" value="<?php 
        echo $_smarty_tpl->tpl_vars['datas']->value['submit']['value'];
        ?>
" name="<?php 
        echo $_smarty_tpl->tpl_vars['datas']->value['submit']['name'];
        ?>
" id="<?php 
        echo $_smarty_tpl->tpl_vars['datas']->value['submit']['id'];
        ?>
"/>	
								        	  </div>
								        	</div>
						          	  
					        	  </form>
					    

<?php 
    }
Exemplo n.º 24
0
 /**
  * Delete the language, this will also delete the language files unless
  * the parameter specifies otherwise.
  *
  * @return boolean
  */
 public function delete($p_deleteLanguageFiles = true)
 {
     if (is_link($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php')) {
         unlink($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php');
     }
     if ($p_deleteLanguageFiles) {
         $result = Localizer::DeleteLanguageFiles($this->getCode());
         if (PEAR::isError($result)) {
             return result;
         }
     }
     $tmpData = $this->m_data;
     $success = parent::delete();
     if ($success) {
         CampCache::singleton()->clear('user');
     }
     return $success;
 }
Exemplo n.º 25
0
if (isset($datos_usuario['id_usuario'])) {
    Settings::setSettingsVars('DEFAULT_LANG', $datos_usuario['codigo_idioma']);
    Settings::setSettingsVars('ID_ZONE', $datos_usuario['id_zone']);
    $name_zone = Combos::getNameTimeZone($datos_usuario['id_zone']);
    Settings::setSettingsVars('NAME_ZONE', $name_zone);
    date_default_timezone_set($name_zone);
    $oSmarty->assign('LOGUEADO', true);
    $aDatosSesionUsuario = $oSesion->getSesion('datos_usuario');
    $oSmarty->assign('datos_sesion', $aDatosSesionUsuario);
} else {
    $oSmarty->assign('LOGUEADO', false);
    $oSesion->cierreSesion();
    $oSmarty->assign('datos_sesion', '');
    Settings::setSettingsVars('DEFAULT_LANG', 'en');
    Settings::setSettingsVars('NAME_ZONE', 'Europe/London');
    date_default_timezone_set('Europe/London');
}
Localizer::init(Settings::getSettingsVars('DEFAULT_LANG'));
// Assign Global language variable
$oSmarty->assign("DEFAULT_LANG", DEFAULT_LANG);
$oSmarty->assign("BASE_URL", BASE_URL);
$oSmarty->assign("config_urls", $config_urls);
// Asignamos la constante definida en el fichero de configuracion con el directorio del sitio.
$oSmarty->assign('DIRECTORIO_SITIO', APP_NAME);
// Asignamos la constante definida en el fichero de configuracion con la ruta relativa hacia el directorio raíz del sitio.
$oSmarty->assign('BASE_PATH', BASE_PATH);
// Asignamos la constante definida en el fichero de configuracion con la ruta absoluta del sitio web.
$oSmarty->assign('RUTA_WEB_ABSOLUTA', BASE_URL);
$oSmarty->assign('BASE_THEMES_URL', BASE_THEMES_URL);
// Asignamos la ruta de las imágenes
$oSmarty->assign('IMAGES_URL', IMAGES_URL);
Exemplo n.º 26
0
/**
 * Load the language files for the given prefix.
 *
 * @param string $p_prefix
 * @return void
 */
function camp_load_translation_strings($p_prefix, $p_langCode = null)
{
    $langCode = null;
    if (!is_null($p_langCode)) {
        $langCode = $p_langCode;
    } elseif (isset($_REQUEST['TOL_Language'])) {
        $langCode = $_REQUEST['TOL_Language'];
    } elseif (isset($_COOKIE['TOL_Language'])) {
        $langCode = $_COOKIE['TOL_Language'];
    }
    Localizer::LoadLanguageFiles($p_prefix, $langCode);
}
Exemplo n.º 27
0
echo "Load XML...<br>";
$xmlLang = new LocalizerLanguage('locals', 'xx');
$result = $xmlLang->loadFile('xml');
if (!$result) {
    echo "Error!  Could not load XML file.<br>";
} else {
    echo "Success!<br>";
}
echo "<br>Load GS...<br>";
$gsLang = new LocalizerLanguage('locals', 'xx');
$result = $gsLang->loadFile('gs');
if (!$result) {
    echo "Error!  Could not load GS file.<br>";
} else {
    echo "Success!<br>";
}
echo "<br>Testing for equality...<br>";
if (!$gsLang->equal($xmlLang)) {
    echo "Error! Not Equal<br>";
    echo "GS: <br>";
    $gsLang->dumpToHtml();
    echo "XML: <br>";
    $xmlLang->dumpToHtml();
} else {
    echo "Success! They are equal<br>";
}
echo "Testing ability to get languages in the base directory...<br>";
$languages = Localizer::GetLanguages();
echo "<pre>";
print_r($languages);
echo "</pre>";
Exemplo n.º 28
0
 /**
  * Updates a user
  *
  * @param int $intId The user ID
  * @param array $arrData The data array
  * @throws Exception
  * @return int The user ID
  */
 public function do_update($intId = null, $arrData)
 {
     $user = null;
     $con = Propel::getConnection();
     if (!$con->beginTransaction()) {
         throw new Exception('Could not start transaction.');
     }
     try {
         $authUser = $this->requireUser();
         $accountId = $authUser->getAccountId();
         $validator = new KickstartValidator();
         $locale = Localizer::getInstance();
         if ($intId and (!isset($arrData['Password']) or $arrData['Password'] == '')) {
             unset($this->filter_basic['Password']);
             unset($arrData['Password']);
             unset($arrData['Password2']);
         }
         $warnings = $validator->filterErrors($arrData, $this->initFilter($this->filter_basic, $locale));
         if ($warnings) {
             return array('result' => false, 'warnings' => $warnings);
         }
         if ($intId) {
             $user = $authUser->getSubordinate($intId);
         } else {
             $user = new User();
             $user->setAccountId($accountId)->setDomainId($authUser->getDomainId());
         }
         if (isset($arrData['Password'])) {
             $user->setPassword($arrData['Password']);
         }
         $allowedFields = array('Name' => true, 'Firstname' => true, 'Lastname' => true, 'Phone' => true, 'Email' => true, 'Number' => true);
         if ($authUser->getIsAdmin()) {
             $allowedFields += array('DomainId' => true, 'ManagerOf' => true, 'IsAdmin' => true);
         }
         $user->fromArray(array_intersect_key($arrData, $allowedFields));
         // Fail if domain does not belong to authenticated account
         $domain = $user->getDomain($con);
         if ($domain === null or $domain->getAccountId() !== $accountId) {
             throw new Exception('Invalid domain ID #' . $user->getDomainId());
         }
         $user->save($con);
         if (!empty($arrData['Properties'])) {
             $user->setProperties($arrData['Properties'], $con);
         }
     } catch (Exception $e) {
         $con->rollBack();
         throw $e;
     }
     if (!$con->commit()) {
         throw new Exception('Could not commit transaction.');
     }
     return $user->getId();
 }
Exemplo n.º 29
0
 public function testGetTextNonExistentKeyWithParams()
 {
     $strings = array();
     $loc = new Localizer($strings);
     $this->assertEquals("FOO_BAR [a,1,b,2]", $loc->getText("FOO_BAR", "a", 1, "b", 2));
 }
Exemplo n.º 30
0
 public function action_ajax_tree(array $params = array())
 {
     $ids = Arr::init($_REQUEST, 'ids', TYPE_ARRAY);
     $bonusOnly = Arr::init($_REQUEST, 'bonusOnly', TYPE_BOOL);
     $rowCount = Arr::init($_REQUEST, 'count', TYPE_INT, 100);
     $byColumn = Arr::init($_REQUEST, 'column', TYPE_STRING, 'ParentId');
     $filterByColumn = "filterBy{$byColumn}";
     $comparisonOperator = \Criteria::IN;
     $memberTypes = Localizer::get('common.member_types');
     $rows = [];
     for ($i = 0; $i < $rowCount; $i++) {
         $members = \MemberQuery::create()->{$filterByColumn}($ids, $comparisonOperator)->orderBy(\MemberPeer::SIGNUP_DATE, \Criteria::ASC);
         if ($bonusOnly) {
             $members->filterByType(\Member::TYPE_MEMBER, \Criteria::GREATER_THAN);
         }
         $members = $members->find();
         if (count($members) === 0) {
             break;
         }
         $row = $members->toArray();
         $newIds = [];
         foreach ($members as $i => $member) {
             $row[$i]['TypeTranslated'] = $memberTypes[$member->getType()];
             $newIds[] = $member->getId();
         }
         $rows[] = $row;
         $ids = $newIds;
     }
     return new ControllerActionAjax($rows);
 }