Esempio n. 1
0
        } else {
            if ($child->getName() == "link") {
                $link = $child;
            } else {
                if ($child->getName() == "mail") {
                    $mail = $child;
                }
            }
        }
    }
    echo '<p>';
    if (strlen($link) == 0 && strlen($mail) > 0) {
        echo '<strong>' . $name . '</strong><br/><a href="mailto:' . $mail . '">' . $mail . '</a>';
    }
    if (strlen($link) > 0 && strlen($mail) == 0) {
        echo '<strong>' . $name . '</strong><br/><a href="http://' . parseLink($link) . '">' . parseLink($link) . '</a>';
    }
    echo '</p>';
}
echo '						</div>
					</div>

					<hr>

					<p><a href="http://dopresskit.com/">presskit()</a> by Rami Ismail (<a href="http://www.vlambeer.com/">Vlambeer</a>) - also thanks to <a href="sheet.php?p=credits">these fine folks</a></p>
				</div>
			</div>
		</div>

		<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
		<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.js"></script>
Esempio n. 2
0
<?php

# Users Application
if ($_GET['arg'] == 'login') {
    if (System::Authority()->guest) {
        System::Authority()->showLogin();
    } else {
        error('You are already logged in', 'If you need to login as a different user <a href="' . parseLink('ex://Users/Logout') . '">logout</a> and log back in');
    }
} else {
    if ($_GET['arg'] == 'logout') {
        if (!System::Authority()->guest) {
            System::Authority()->sessionDestroy(System::Authority()->session['id']);
            error('You have been logged out');
        } else {
            error('You are not logged in', 'You must <a href="' . parseLink('ex://Users/Login') . '">Login</a> before you can logout.');
        }
    } else {
        if ($_GET['arg'] > 0) {
            // Not a priority
        } else {
            if ($_GET['arg'] > 'account') {
                // Not a priority
            }
        }
    }
}
Esempio n. 3
0
<?php

# Preferences Application
if (isset($_GET['arg'])) {
    $_GET['arg'] = 'system';
}
crunch($_GET['arg'], null);
foreach (fsGetPreferences() as $p_item) {
    include $p_item . 'Info.php';
    $path_parts = pathinfo($p_item);
    $link_name = $path_parts['basename'];
    $preferences[] = array('name' => priority_select($preferences['name'], $link_name), 'link' => parseLink("ex://Preferences/{$link_name}"));
}
Esempio n. 4
0
/**
 * Parses the style tags of the given xml element and uses them to generate
 * the associated html code.
 * @param SimpleXMLElement $xmlElement
 * @param boolean $shouldAddSwapToLinks
 * @param string $cssMenuClassName
 *
 * @return string
 * @author Andrew Darwin <*****@*****.**>
 */
function getElementContentWithStyleTags($xmlElement, $shouldAddSwapToLinks, $cssMenuClassName)
{
    $header = "getElementContentWithStyleTags(): ";
    logMessage("{$header} Beginning call...\n" . "xmlElement = '" . getTrimmed($xmlElement) . "'\n" . "shouldAddSwapToLinks = some boolean\n" . "cssMenuClassName = '{$cssMenuClassName}'");
    $attributes = $xmlElement->attributes();
    logMessage("{$header} Obtained attributes from XML Element, '{$xmlElement}'");
    $output = "";
    $prefix = "";
    $suffix = "";
    $urlSpecified = false;
    $urlOpenTag = "";
    $urlCloseTag = "";
    $outputHTMLAttributes = "";
    if ($attributes != null) {
        foreach ($attributes as $attribute) {
            $currentAttributeName = $attribute->getName();
            switch ($currentAttributeName) {
                case "style":
                    $styles = formatStyleAttribute($attribute);
                    foreach ($styles as $style) {
                        addToPrefix($prefix, "<{$style}>");
                        addToSuffix($suffix, "</{$style}>");
                    }
                    break;
                case "css":
                    $outputHTMLAttributes = "class=\"{$attribute}\"";
                    break;
                case "url":
                    // Must apply url last, so lets save it to a variable and do
                    // stuff with it later
                    $urlSpecified = true;
                    $loadURLPrefix = "";
                    if (strpos(getcwd(), "resources/scripts") == false) {
                        $loadURLPrefix = "resources/scripts/";
                    }
                    // Escape any necessary characters from the url
                    $attribute = clean_url($attribute);
                    logMessage("{$header} Clean url = '{$attribute}'");
                    $target = getAttributeValue($xmlElement, "target");
                    $isExternal = is_link_external($attribute);
                    $loadURLPrefix .= "loadURL.php";
                    $extension = pathinfo($attribute, PATHINFO_EXTENSION);
                    if ($extension == "xml") {
                        $href = "'{$loadURLPrefix}?url={$attribute}'";
                    } else {
                        $href = "'{$attribute}'";
                    }
                    if ($target == "new_tab" || $target != "same_tab" && is_link_external($attribute)) {
                        $href .= " target='_blank'";
                        $shouldAddSwapToLinks = false;
                    }
                    $urlOpenTag = "<a href={$href}";
                    if ($shouldAddSwapToLinks) {
                        $urlOpenTag .= " target='innerframe'";
                    }
                    if ($cssMenuClassName != "") {
                        $urlOpenTag .= " class='{$cssMenuClassName}'";
                    }
                    $urlOpenTag .= ">";
                    $urlCloseTag = "</a>";
            }
        }
        if ($urlSpecified) {
            addToPrefix($prefix, $urlOpenTag);
            addToSuffix($suffix, $urlCloseTag);
        }
    } else {
        logMessage("{$header} The XML Element, '{$xmlElement}' had no attributes. " . "Continue without applying any attributes or styles.");
    }
    $innerContent = getTrimmed($xmlElement);
    if (hasChildren($xmlElement)) {
        $children = $xmlElement->children();
        $child = $children[0];
        if ($child->getName() == "link") {
            logMessage("{$header} Determined that XML Element, '" . getTrimmed($xmlElement) . "' has link children. Set " . "inner content to [recursive call]...");
            $innerContent = parseLink($xmlElement);
            logMessage("{$header} InnerContent is now '{$innerContent}' after " . "calling parseLink");
        } else {
            logMessage("{$header} Determined xml element, '" . getTrimmed($xmlElement) . "' has children, but not LINK children");
        }
    } else {
        logMessage("{$header} Determined that XML Element, '" . getTrimmed($xmlElement) . "' does not have any link " . "children. Set inner content to '" . getTrimmed($xmlElement) . "'");
    }
    $output = $prefix . $innerContent . $suffix;
    logMessage("{$header} Return '{$output}'");
    return $output;
}