Пример #1
0
Copyright 2014 Patrick Smith
*/
$pageDisplayer = PvlpPageDisplayer::getCurrentPageDisplayer();
stir('footer');
?>
</div>
<?php 
stirring('footer', 'banner');
?>
<footer id="footer">
<div class="content">
<?php 
// Legals, Copyright
$pageDisplayer->displayFooterLegals();
// Footer Navigation
$mainNavigation = glazyBegin('nav#footerNavigation');
$pageDisplayer->displayFooterMenuContents();
glazyFinish($mainNavigation);
stirring('header', 'main navigation');
?>
</div>
</footer>
<?php 
wp_footer();
stirring('footer', 'wp_footer');
?>
</div>
<?php 
stirring('whole', 'footer');
stirred('footer');
stirDisplayRecordedTimesForHTML();
Пример #2
0
$classNamesArray[] = !empty($info['published']) ? 'published' : 'upcoming';
$classNamesArray[] = 'genre-' . $info['genreIdentifier'];
// e.g. 'genre-thriller'
// Begin the <div>
$bookItemDiv = glazyBegin('div');
glazyAttribute('id', "bookItem-{$info['itemID']}");
// Lets you use an array of strings for class attributes.
glazyAttribute('class', $classNamesArray);
// Only display the attribute if variable reference $info['salesCount'] is present.
glazyAttributeCheck('data-sales-count', $info['salesCount']);
glazyAttributeCheck('data-sales-count', $info['salesCount_NOPE']);
// Only displays the attribute, with the value 'selected', if $info['selected'] is true.
glazyAttributeCheck('selected', $info['selected'], 'selected');
glazyAttributeCheck('selected-nope', $info['selected_NOPE'], 'selected');
glazyElement('h5.authorName', glazyCheckContent($info['authorName']));
glazyElement('p.description', glazyPrepareContentJoinedByLineBreaks(glazyCheckContent($info['itemDescription'])));
glazyElement('p.description', glazyPrepareContentJoinedByLineBreaks(glazyCheckContent($info['itemDescription_NOPE'])));
// Finish and close the </div>
glazyFinish($bookItemDiv);
glazyElement('h2', 'These are already escaped &amp; &lt; &gt;', GLAZE_TYPE_PREGLAZED);
$img = glazyBegin('img');
glazyAttribute('src', 'http://placehold.it/150x50');
$escapedText = 'Bangers &amp; Mash';
glazyAttribute('alt', $escapedText, GLAZE_TYPE_PREGLAZED);
glazyFinish($img);
glazyElement('hr');
glazyElement('p', array('Updating this file by using: ', glazyPrepareElement('br'), glazyPrepareElement('code', 'php -f example-update.php')));
glazyElement('p', array('Check this file with the last version by using: ', glazyPrepareElement('br'), glazyPrepareElement('code', 'php -f example-check.php')));
glazyElement('p', array('You can download glaze.php from here: ', glazyPrepareElement(array('tagName' => 'a', 'href' => 'http://github.com/BurntCaramel/glaze'), 'github.com/BurntCaramel/glaze')));
glazyFinish($body);
glazyFinish($html);
Пример #3
0
function perforatedFormDisplayEntry($entryID, $entryDetails, $options, $callbacks)
{
    $baseID = $options['baseID'];
    $problemIDsToMessages = $options['problemIDsToMessages'];
    $entryTitle = $entryDetails['title'];
    $entryType = $entryDetails['type'];
    $entryValue = !empty($entryDetails['value']) ? $entryDetails['value'] : '';
    $entryInputName = "{$baseID}[{$entryID}]";
    $entryTextTag = !empty($options['textTagName']) ? $options['textTagName'] : 'h5';
    $entryIsRequired = !empty($entryDetails['required']);
    $glazyLabel = glazyBegin(array('tagName' => 'label', 'id' => $entryID, 'class' => $entryType, 'data-entry-i-d' => $entryID));
    $textElement = glazyBegin(array('tagName' => $entryTextTag));
    glazyElement('span.title', $entryTitle);
    if (isset($options['problems'][$entryID])) {
        foreach ($options['problems'][$entryID] as $problemID => $problemValue) {
            if (isset($problemIDsToMessages['types'][$entryType][$problemID])) {
                $problemMessage = $problemIDsToMessages['types'][$entryType][$problemID];
            } else {
                $problemMessage = $problemIDsToMessages['base'][$problemID];
            }
            glazyElement('span.problem', $problemMessage);
        }
    }
    glazyFinish($textElement);
    if (empty($callbacks['inputElementTypeForEntryType'])) {
        throw new Exception('Perforated: A input element type for entry type callback *must* be set: $callbacks["inputElementTypeForEntryType"] is empty.');
    } else {
        $inputElementTypeForEntryTypeCallback = $callbacks['inputElementTypeForEntryType'];
    }
    $inputType = call_user_func($inputElementTypeForEntryTypeCallback, $entryType);
    if ($inputType === 'text' && empty($entryDetails['multipleLines']) || $inputType === 'email' || $inputType === 'url' || $inputType === 'number' || $inputType === 'checkbox') {
        $input = glazyBegin('input');
        glazyAttribute('type', $inputType);
        glazyAttribute('name', $entryInputName);
        glazyAttributeCheck('required', $entryIsRequired);
        if ($inputType === 'checkbox') {
            glazyAttributeCheck('checked', $entryDetails['value'], 'checked');
            glazyAttribute('data-on-title', $entryDetails['titleWhenOn']);
            glazyAttribute('data-off-title', $entryDetails['titleWhenOff']);
        } else {
            glazyAttribute('value', $entryValue);
        }
        if ($entryType === 'integer') {
            glazyAttribute('step', '1');
        }
        glazyFinish($input);
    } elseif ($inputType === 'text' && !empty($entryDetails['multipleLines'])) {
        glazyElement(array('tagName' => 'textarea', 'name' => $entryInputName, 'required' => !empty($entryDetails['required']), 'cols' => 40, 'rows' => 4), $entryValue);
    }
    glazyFinish($glazyLabel);
}
Пример #4
0
function pvlpBeginDisplayingButtonsAside($options = null)
{
    return glazyBegin(array('tagName' => 'aside', 'class' => 'buttons'));
}
Пример #5
0
<script>
document.documentElement.className += " " + document.body.className;
</script>
<div id="page">
<header id="header">
<div class="content">
<h1><a href="<?php 
echo home_url('/');
?>
"><?php 
echo glazeText(PVLP_SITE_TITLE);
?>
</a></h1>
<?php 
if (true) {
    $mainNavigation = glazyBegin('nav#mainNavigation');
    $pageDisplayer->displayMainMenuContents();
    glazyFinish($mainNavigation);
    stirring('header', 'main navigation');
}
if (false) {
    ?>
<div id="siteSearch">
<h3 id="mainSearchButton"><a href="#search">Search</a></h3>
<div id="searchForm">
<?php 
    get_search_form();
    ?>
</div>
</div>
<?php 
Пример #6
0
 public function beginDisplayingSectionWithID($sectionID, $options = null)
 {
     $options = $this->setUpDefaultOptionsForDisplaySection($options);
     glazyBegin('section');
     glazyAttribute('id', $this->sectionElementID($sectionID));
     if (!empty($options['addContentElement'])) {
         glazyBegin('div');
         $classes = array('content');
         if (!empty($options['wider'])) {
             $classes[] = 'contentWider';
         }
         glazyAttribute('class', $classes);
     }
     // WordPress's shortcode runs first and displays later, so make sure glazy is ready.
     glazyEnsureOpeningTagForLatestElementIsDisplayed();
 }