Example #1
0
']);" title="<?php 
                printf(gettext('Assign %s as your album theme'), $theme);
                ?>
">
							<img src="images/pass.png" alt="" /><?php 
                echo gettext("Assign");
                ?>
						</a>
					</p>
					</li>
					<?php 
            } else {
                echo "<li><strong>" . gettext("Current Theme") . "</strong></li>";
            }
        }
        if (themeIsEditable($theme, $themes)) {
            ?>
				<li>
				<p class="buttons">
					<a onclick="launchScript('admin-themes-editor.php',['theme=<?php 
            echo $theme;
            ?>
']);" title="<?php 
            printf(gettext('Edit %s'), $theme);
            ?>
">
						<img src="images/pencil.png" alt="" /><?php 
            echo gettext("Edit");
            ?>
					</a>
				</p><br />
Example #2
0
}
$ok_extensions = array('css', 'php', 'js', 'txt', 'inc');
function isTextFile($file)
{
    global $ok_extensions;
    $ext = strtolower(getSuffix($file));
    return in_array($ext, $ok_extensions);
}
$messages = $file_to_edit = $file_content = null;
$what = 'edit';
$themes = $_zp_gallery->getThemes();
$theme = basename(sanitize($_GET['theme']));
$themedir = SERVERPATH . '/themes/' . internalToFilesystem($theme);
$themefiles = listDirectoryFiles($themedir);
$themefiles_to_ext = array();
if (themeIsEditable($theme)) {
    foreach ($themefiles as $file) {
        if (isTextFile($file)) {
            $themefiles_to_ext[getSuffix($file)][] = $file;
            // array(['php']=>array('file.php', 'image.php'),['css']=>array('style.css'))
        } else {
            unset($themefiles[$file]);
            // $themefile will eventually have all editable files and nothing else
        }
    }
    if (isset($_GET['file'])) {
        if (!in_array($themedir . '/' . $_GET['file'], $themefiles)) {
            $messages['errorbox'][] = gettext('Cannot edit this file!');
        }
        $file_to_edit = str_replace('\\', '/', SERVERPATH . '/themes/' . internalToFilesystem($theme) . '/' . sanitize($_GET['file']));
    }
Example #3
0
                echo getXSRFToken('admin-themes');
                ?>
']);">
											<img src="images/pass.png" alt="" /><?php 
                echo gettext("Assign");
                ?>
										</a>
									</p>
								</li>
								<?php 
            } else {
                echo "<li><strong>" . gettext("Current Theme") . "</strong></li>";
            }
        }
        $editable = zp_apply_filter('theme_editor', '', $theme);
        if ($editable && themeIsEditable($theme)) {
            ?>
							<li>
								<p class="buttons">
									<a onclick="<?php 
            echo $editable;
            ?>
;">
										<img src="images/pencil.png" alt="" /><?php 
            echo gettext("Edit");
            ?>
									</a>
								</p><br />
							</li>
							<?php 
            if ($theme != $current_theme) {