示例#1
0
<?php

/**
 * CustomStyle - Color configure
 * 
 * @package customstyle
 * @author ColdTrick IT Solutions
 * @copyright Coldtrick IT Solutions 2009
 * @link http://www.coldtrick.com/
 */
gatekeeper();
$current_user = $_SESSION['user']->getGUID();
$current_user_entity = $_SESSION['user'];
$currentConfig = get_custom_style_from_metadata($current_user, 'customstylecolors');
$cust .= "<table class='customstyle'><col style='white-space:nowrap'>";
// creating fields for autodetecting of css colors
$cust .= "<div style='display:none;'>";
$cust .= "<div id='profile_info'></div>";
$cust .= "<div class='collapsable_box_header'><h1></h1></div>";
$cust .= "<div class='collapsable_box_content'></div>";
$cust .= "</div>";
$configArray = array(array('title' => elgg_echo("customstyle:colors:configure:background:title"), 'internalname' => "bodybackground", 'html-element' => "body", 'css-element' => "body", 'css-property' => "background-color", 'info' => elgg_echo("customstyle:colors:configure:background:info")), array('title' => elgg_echo("customstyle:colors:configure:headerbackground:title"), 'internalname' => "headerbackground", 'html-element' => "#layout_header", 'css-element' => "#layout_header", 'css-property' => "background-color", 'info' => elgg_echo("customstyle:colors:configure:headerbackground:info")), array('title' => elgg_echo("customstyle:colors:configure:profilebox:title"), 'internalname' => "profilebox", 'html-element' => "#profile_info", 'css-element' => "#profile_info", 'css-property' => "background-color", 'info' => elgg_echo("customstyle:colors:configure:profilebox:info")), array('title' => elgg_echo("customstyle:colors:configure:widgettitle:title"), 'internalname' => "widgettitle", 'html-element' => ".collapsable_box_header h1", 'css-element' => ".collapsable_box_header h1", 'css-property' => "color", 'info' => elgg_echo("customstyle:colors:configure:widgettitle:info")), array('title' => elgg_echo("customstyle:colors:configure:widgetheader:title"), 'internalname' => "widgetheader", 'html-element' => ".collapsable_box_header", 'css-element' => ".collapsable_box_header", 'css-property' => "background-color", 'info' => elgg_echo("customstyle:colors:configure:widgetheader:info")), array('title' => elgg_echo("customstyle:colors:configure:widgetbody:title"), 'internalname' => "widgetbody", 'html-element' => ".collapsable_box_content", 'css-element' => ".collapsable_box_content", 'css-property' => "background-color", 'info' => elgg_echo("customstyle:colors:configure:widgetbody:info")), array('title' => elgg_echo("customstyle:colors:configure:fontcolor:title"), 'internalname' => "fontcolor", 'html-element' => "#page_container", 'css-element' => "#page_container", 'css-property' => "color", 'info' => elgg_echo("customstyle:colors:configure:fontcolor:info")), array('title' => elgg_echo("customstyle:colors:configure:linkcolor:title"), 'internalname' => "linkcolor", 'html-element' => "#page_container a", 'css-element' => "#page_container a", 'css-property' => "color", 'info' => elgg_echo("customstyle:colors:configure:linkcolor:info")));
$customJs = "";
foreach ($configArray as $configElement) {
    //creating the form elements
    $cust .= "<tr><th colspan=2>" . $configElement['title'] . "</th></tr>\n";
    $cust .= "<tr><td>\n";
    $cust .= "<input type='text' id='" . $configElement['internalname'] . "A' name='customstyle[" . $configElement['css-element'] . "|" . $configElement['css-property'] . "]' onchange=\"setElementColor('" . $configElement['html-element'] . "', '" . $configElement['css-property'] . "', this.value)\" /><br />\n";
    $cust .= "<input type='checkbox' id='" . $configElement['internalname'] . "B' name='customstyle[" . $configElement['css-element'] . "|" . $configElement['css-property'] . "]' value='transparent' onclick=\"if(this.checked==true){" . $configElement['internalname'] . "A.disabled=true;setElementColor('" . $configElement['html-element'] . "', '" . $configElement['css-property'] . "', 'transparent');} else {" . $configElement['internalname'] . "A.disabled=false;setElementColor('" . $configElement['html-element'] . "', '" . $configElement['css-property'] . "', " . $configElement['internalname'] . "A.value);}\" /> \n";
    $cust .= elgg_echo("customstyle:colors:configure:transparent") . "</td>\n";
    $cust .= "<td>" . $configElement['info'] . "</td></tr>\n";
示例#2
0
<?php

/**
 * CustomStyle - Overrides all loaded css (not inline style)
 * 
 * @package customstyle
 * @author ColdTrick IT Solutions
 * @copyright Coldtrick IT Solutions 2009
 * @link http://www.coldtrick.com/
 */
global $CONFIG;
$important = "";
if (elgg_get_context() != "customstyle") {
    $important = " !important";
}
$currentConfig = get_custom_style_from_metadata(elgg_get_page_owner_guid(), 'customstylebackground');
if (elgg_get_context() == "profile") {
    if ($currentConfig) {
        // background configured
        ?>
			<style type="text/css" title="customstylesheet">
				/* customstylebackground */
				.elgg-page-default .elgg-page-body {
					<?php 
        foreach ($currentConfig as $key => $value) {
            if ($key == 'background-image') {
                echo $key . ": url(" . $CONFIG->wwwroot . $value . ")" . $important . ";\n";
            } else {
                echo $key . ": " . $value . $important . ";\n";
            }
        }
示例#3
0
<?php

/**
 * CustomStyle - Background configuration
 * 
 * @package customstyle
 * @author ColdTrick IT Solutions
 * @copyright Coldtrick IT Solutions 2009
 * @link http://www.coldtrick.com/
 */
gatekeeper();
$current_user = $_SESSION['user']->getGUID();
$currentConfig = get_custom_style_from_metadata($current_user, 'customstylebackground');
$wallpaper_path = "mod/customstyle/graphics/wallpapers";
$imageArray = array();
$dir_handle = opendir($CONFIG->path . $wallpaper_path);
while (($file = readdir($dir_handle)) !== false) {
    if ($file != '.' && $file != '..' && !is_dir($dir . $entry)) {
        $dotPosition = strrpos($file, ".");
        if ($dotPosition) {
            $shortFileName = substr($file, 0, $dotPosition);
            $imageArray[elgg_echo($shortFileName)] = $wallpaper_path . "/" . str_replace(" ", "%20", $file);
        }
    }
}
$cust = "<br />";
$cust .= "<table id='gallery'><tr>";
$i = 0;
// own image
if ($currentConfig["background-image"]) {
    $cust .= "<td>";