Esempio n. 1
0
    /**
     * Prints out the HTML to choose a language
     * @param none
     */
    function print_language_pulldown()
    {
        global $conf;
        ?>
		<select name="language" class="textbox" onchange="changeLanguage(this);">
		<?php 
        $languages = get_language_list();
        foreach ($languages as $lang => $settings) {
            echo '<option value="' . $lang . '"' . (determine_language() == $lang ? ' selected="selected"' : '') . '>' . $settings[3] . ($lang == $conf['app']['defaultLanguage'] ? ' ' . translate('(Default)') : '') . "</option>\n";
        }
        ?>
		</select>
		<?php 
    }
Esempio n. 2
0
            CmnFns::do_error_box(translate('This is only accessable to the administrator'), '', true);
        }
    }
}
// If we are editing and have not yet submitted an update
if ($edit && !isset($_POST['update'])) {
    $user = new User($id);
    $data = $user->get_user_data();
    $data['emailaddress'] = $data['email'];
    // Needed to be the same as the form
} else {
    $data = CmnFns::cleanPostVals();
}
if (isset($_POST['register'])) {
    // New registration
    $data['lang'] = determine_language();
    $adminCreated = Auth::is_logged_in() && Auth::isAdmin();
    $msg = $auth->do_register_user($data, $adminCreated);
    $show_form = false;
} else {
    if (isset($_POST['update'])) {
        // Update registration
        $adminUpdate = $curUser->get_id() != $id && (Auth::isAdmin() || $curUser->is_group_admin(array($id)));
        $msg = $auth->do_edit_user($data, $adminUpdate);
        $show_form = false;
    }
}
// Print HTML headers
$t->printHTMLHeader();
$t->set_title($edit ? translate('Modify My Profile') : translate('Register'));
// Print the welcome banner if they are logged in
Esempio n. 3
0
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the
* Free Software Foundation, Inc.
* 59 Temple Place
* Suite 330
* Boston, MA
* 02111-1307
* USA
*/
/********************************************************************/
/*                   DO NOT CHANGE THIS SECTION                     */
/********************************************************************/
// Set session name
ini_set('session.name', $conf['app']['sessionName']);
//AK: The line bellow sets inactivity timeout for session. It doesn't guruantee that the session will timeout exactly after time specified. It more random, but it is the easiest way to do it.
ini_set('session.gc_maxlifetime', 60);
// Start the session (do not edit!)
session_start();
// Turn off magic quotes (do not edit!)
set_magic_quotes_runtime(0);
$conf['app']['version'] = '1.2.8';
include_once 'constants.php';
include_once 'langs.php';
if ($lang = determine_language()) {
    // Functions exist in the langs.php file
    set_language($lang);
    load_language_file($lang);
}
/********************************************************************/
<?php

$directories = ['/modules/system/lang/', '/modules/cms/lang/', '/modules/backend/lang/'];
global $langs;
$langs = [];
if (count($argv) != 3 or paths_are_valid($argv[1], $argv[2]) === false) {
    echo "Usage:\n-----------------------------\n";
    echo "php -f convert_octobercms_langs.php [full_path_to_october] [full_path_to_lucid_install]\n";
    exit("\n");
}
$october_path = $argv[1];
$lucid_path = $argv[2];
foreach ($directories as $dir) {
    $lang_dirs = glob($october_path . $dir . '*');
    foreach ($lang_dirs as $lang_dir) {
        $lang = determine_language($lang_dir);
        echo "--------------------------------\n";
        echo "Language: {$lang}\n";
        import_phrases($lang, $lang_dir . '/lang.php', '');
        import_phrases($lang, $lang_dir . '/client.php', '');
        import_phrases($lang, $lang_dir . '/validation.php', 'validation:');
    }
}
foreach ($langs as $key => $list) {
    ksort($langs[$key]);
}
echo "--------------------------------\n";
echo "Language parsing complete, preparing to write files\n";
echo "--------------------------------\n";
foreach ($langs as $lang => $phrases) {
    write_lucid_file($lucid_path, $lang, $phrases);