Exemplo n.º 1
0
/**
 * Returns only theme names with their htmlised representation
 * { name=>html, ...}
 */
function getThemeNames() {
    $themes = getThemeList();
    $names = array();
    foreach($themes as $name=>$style) {
        $names[$name] = toHTML($name);
    }
    return $names;
}
    echo $i;
    ?>
" onchange="updateThemeLevels(<?php 
    echo $i;
    ?>
);"><option value=""><?php 
    echo $lang["select"];
    ?>
</option>
			<?php 
    if ($thisval == '') {
        $printedval = true;
    } else {
        $printedval = false;
    }
    foreach (getThemeList($parents) as $theoption) {
        if ($theoption == $thisval) {
            echo "<option selected>" . htmlspecialchars($theoption) . "</option>";
            $printedval = true;
        } else {
            echo "<option>" . htmlspecialchars($theoption) . "</option>";
        }
    }
    if (!$printedval) {
        // we never found the currently selected value, so we'll add it at the bottom.
        echo "<option selected>" . htmlspecialchars($thisval) . "</option>";
    }
    ?>
		</select>
		<div class="clearerleft"> </div>
		<label><?php 
Exemplo n.º 3
0
?>
</td>
				</tr>

				<tr class="ui-helper-reset">
					<th>Manager</th>
					<td><?php 
echo form_dropdown('user_manager', $users);
?>
</td>
				</tr>

				<tr>
					<th>UI Theme</th>
					<td><?php 
echo form_dropdown('meta[theme]', getThemeList());
?>
</td>
				</tr>	

				<tr class="ui-helper-reset">
					<th>Available Accounts</th>
					<td>
						<table>
							<thead>
								<tr>
									<th>Assigned Accounts</th>
									<th>Available Accounts</th>
								</tr>
							</thead>
							<tbody>
Exemplo n.º 4
0
?>
</td>
				</tr>

				<tr class="ui-helper-reset">
					<th>Manager</th>
					<td><?php 
echo form_dropdown('user_manager', $users, $user->user_manager);
?>
</td>
				</tr>

				<tr>
					<th>UI Theme</th>
					<td><?php 
echo form_dropdown('meta[theme]', getThemeList(), $user->meta['theme']);
?>
</td>
				</tr>	

				<tr class="ui-helper-reset">
					<?php 
$current = unserialize(base64_decode($user->accounts));
?>
					<th>Available Accounts</th>
					<td>
						<table>
							<thead>
								<tr>
									<th>Assigned Accounts</th>
									<th>Available Accounts</th>
Exemplo n.º 5
0
 /**
  * displayDefaultsForm
  * 
  * @return void
  */
 function displayDefaultsForm()
 {
     $this->displayHeader();
     // Defaults Config
     $sql = "DESCRIBE `fcms_user_settings`";
     $rows = $this->fcmsDatabase->getRows($sql);
     if ($rows === false) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     foreach ($rows as $drow) {
         if ($drow['Field'] == 'theme') {
             $default_theme = $drow['Default'];
         }
         if ($drow['Field'] == 'displayname') {
             $default_displayname = $drow['Default'];
         }
         if ($drow['Field'] == 'frontpage') {
             $default_frontpage = $drow['Default'];
         }
         if ($drow['Field'] == 'timezone') {
             $default_tz = $drow['Default'];
         }
         if ($drow['Field'] == 'dst') {
             $default_dst = $drow['Default'];
         }
         if ($drow['Field'] == 'boardsort') {
             $default_boardsort = $drow['Default'];
         }
     }
     // Themes
     $themes = getThemeList();
     $theme_options = '';
     foreach ($themes as $file) {
         $theme_options .= '<option value="' . $file . '"';
         if ($default_theme == $file) {
             $theme_options .= ' selected="selected"';
         }
         $theme_options .= ">{$file}</option>";
     }
     // Display Name
     $displayname_list = array("1" => T_('First Name'), "2" => T_('First & Last Name'), "3" => T_('Username'));
     $displayname_options = buildHtmlSelectOptions($displayname_list, $default_displayname);
     // Frontpage
     $frontpage_list = array("1" => T_('All (by date)'), "2" => T_('Last 5 (by plugin)'));
     $frontpage_options = buildHtmlSelectOptions($frontpage_list, $default_frontpage);
     // Timezone
     $tz_list = getTimezoneList();
     $tz_options = buildHtmlSelectOptions($tz_list, $default_tz);
     // DST
     $dst_list = array(1 => T_('On'), 0 => T_('Off'));
     $dst_options = buildHtmlSelectOptions($dst_list, $default_dst);
     // Board Sort
     $boardsort_list = array("ASC" => T_('New Messages at Bottom'), "DESC" => T_('New Messages at Top'));
     $boardsort_options = buildHtmlSelectOptions($boardsort_list, $default_boardsort);
     $message = '';
     if (isset($_SESSION['success'])) {
         $message = '<div class="alert-message success">';
         $message .= '<a class="close" href="#" onclick="$(this).up(\'div\').hide(); return false;">&times;</a>';
         $message .= T_('Changes Updated Successfully') . '</div>';
         unset($_SESSION['success']);
     }
     echo '
     <form action="config.php?view=defaults" method="post">
     ' . $message . '
     <fieldset>
         <legend>' . T_('New Member Default Settings') . '</legend>
         <div class="clearfix">
             <label for="theme">' . T_('Theme') . '</label>
             <div class="input">
                 <select name="theme" id="theme">
                     ' . $theme_options . '
                 </select>
             </div>
         </div>
         <div class="clearfix">
             <label for="displayname">' . T_('Display Name') . '</label>
             <div class="input">
                 <select name="displayname" id="displayname" title="' . T_('How do you want your name to display?') . '">
                     ' . $displayname_options . '
                 </select>
             </div>
         </div>
         <div class="clearfix">
             <label for="frontpage">' . T_('Front Page') . '</label>
             <div class="input">
                 <select name="frontpage" id="frontpage" title="' . T_('How do you want the latest information to display on the homepage?') . '">
                     ' . $frontpage_options . '
                 </select>
             </div>
         </div>
         <div class="clearfix">
             <label for="timezone">' . T_('Time Zone') . '</label>
             <div class="input">
                 <select class="span8" name="timezone" id="timezone" title="' . T_('What time zone do you live in?') . '">
                     ' . $tz_options . '
                 </select>
             </div>
         </div>
         <div class="clearfix">
             <label for="dst">' . T_('Daylight Savings Time') . '</label>
             <div class="input">
                 <select name="dst" id="dst">
                     ' . $dst_options . '
                 </select>
             </div>
         </div>
         <div class="clearfix">
             <label for="boardsort">' . T_('Sort Messages') . '</label>
             <div class="input">
                 <select name="boardsort" id="boardsort" title="' . T_('How do you want messages to display on the Message Board?') . '">
                     ' . $boardsort_options . '
                 </select>
             </div>
         </div>
         <div class="clearfix">
             <label>&nbsp;</label>
             <div class="input">
                 <ul class="inputs-list">
                     <li>
                         <label>
                             <input type="checkbox" name="changeAll" id="changeAll"/> 
                             <span>' . T_('Update existing users?') . '</span>
                         </label>
                     </li>
                 </ul>
             </div>
         </div>
         <div class="actions">
             <input type="submit" id="submit-defaults" name="submit-defaults" class="btn primary" value="' . T_('Save') . '"/> &nbsp;
         </div>
     </fieldset>
     </form>';
     $this->displayFooter();
 }
Exemplo n.º 6
0
    /**
     * displayTheme 
     * 
     * @return void
     */
    function displayTheme()
    {
        $sql = "SELECT `theme`\n                FROM `fcms_user_settings`\n                WHERE `user` = ?";
        $row = $this->fcmsDatabase->getRow($sql, $this->fcmsUser->id);
        if ($row === false) {
            $this->fcmsError->displayError();
            return;
        }
        // Theme
        $themes = array();
        $themeList = getThemeList();
        foreach ($themeList as $file) {
            $themeData = $this->getThemeData($file);
            $themes[$file] = $themeData;
        }
        $currentTheme = $themes[$row['theme']];
        // current theme screenshot
        if (file_exists('ui/themes/' . $currentTheme['file'] . '/screenshot.png')) {
            $img = '<img src="ui/themes/' . $currentTheme['file'] . '/screenshot.png"/>';
        } else {
            $img = '<span>' . T_('No Preview') . '</span>';
        }
        echo '
                <h3>' . T_('Current Theme') . '</h3>

                <div class="current-theme">
                    ' . $img . '
                    <div>
                        <p><b>' . $currentTheme['name'] . '</b></p>
                        <p>' . $currentTheme['desc'] . '</p>
                        <p>' . $currentTheme['author'] . '<br/>' . $currentTheme['updated'] . '</p>
                    </div>
                </div>

                <h3>' . T_('Themes') . '</h3>';
        $canDelete = false;
        if ($this->fcmsUser->access == 1) {
            $canDelete = true;
        }
        foreach ($themes as $theme) {
            // skip current theme
            if ($theme['file'] == $row['theme']) {
                continue;
            }
            // screenshot
            if (file_exists('ui/themes/' . $theme['file'] . '/screenshot.png')) {
                $img = '<img src="ui/themes/' . $theme['file'] . '/screenshot.png"/>';
            } else {
                $img = '<span>' . T_('No Preview') . '</span>';
            }
            // only admin can delete themes
            $del = '';
            if ($canDelete) {
                $del = ' | <a class="del_theme"href="?view=theme&amp;delete=' . $theme['file'] . '">' . T_('Delete') . '</a>';
            }
            echo '
                <div class="theme-block">
                    <a href="?view=theme&amp;use=' . $theme['file'] . '" 
                        title="' . T_('Click to use this theme.') . '">' . $img . '</a><br/>
                    <b>' . $theme['name'] . '</b>
                    <p><a href="?view=theme&amp;use=' . $theme['file'] . '">' . T_('Use Theme') . '</a>' . $del . '</p>
                    <p>' . $theme['desc'] . '</p>
                    <p>' . $theme['author'] . '<br/>' . $theme['updated'] . '</p>
                </div>';
        }
    }
Exemplo n.º 7
0
    return;
}
//everything went fine so store album location in session
$_SESSION['albumLocation'] = $albumLocation;
//get a image listing
if (isset($_SESSION['albumLocation'])) {
    chdir($_SERVER['DOCUMENT_ROOT'] . '/' . $_SESSION['albumLocation']);
    $_SESSION['imageList'] = array_merge(glob('*.png'), glob('*.jpg'), glob('*.jpeg'), glob('*.gif'));
}
$_SESSION['imageCount'] = 0;
//set to -1 so that first load arranges everything properly
/********************************
 2. Check if theme exists.
    Otherwise switch to default
********************************/
$availableThemes = getThemeList();
if (!array_key_exists($albumTheme, $availableThemes)) {
    $albumTheme = PF_DEFAULT_THEME;
}
$albumThemeLocation = $availableThemes[$albumTheme];
//assign variables to session equivalents
$_SESSION['albumThemeLocation'] = $albumThemeLocation;
$_SESSION['albumName'] = $albumName;
//now generate the headers
define(ALBUM_TITLE, $albumName);
define(COMMON_STYLE, "style.css");
define(CLIENT_STYLE, $albumThemeLocation . PF_THEME_STYLE_FILE);
define(CLIENT_JS, PF_REL_INSTALL_DIR . "client/" . PF_CLIENT_JS);
define(JUICE, PF_REL_INSTALL_DIR . "client/juice_client.js");
define(CURRENT_IMAGE, $_SESSION['albumLocation'] . '/' . $_SESSION['imageList'][$_SESSION['imageCount']]);
//include the theme index.html