예제 #1
0
function pvlpShortcodeEmailButton($shortcodeAttributes, $content = '')
{
    ob_start();
    $shortcodeAttributes = shortcode_atts(array('email_address' => '', 'class' => ''), $shortcodeAttributes, 'pvlp_email_button');
    $class = array('emailAddressButtonLink', 'buttonLink');
    if (!empty($shortcodeAttributes['class'])) {
        $class[] = $shortcodeAttributes['class'];
    }
    $processedContent = do_shortcode(trim($content));
    glazyElement(array_filter(array('tagName' => 'a', 'href' => array('value' => $shortcodeAttributes['email_address'], 'valueType' => GLAZE_TYPE_EMAIL_ADDRESS_MAILTO_URL), 'class' => $class)), $content);
    return ob_get_clean();
}
예제 #2
0
파일: glaze.php 프로젝트: burntcaramel/pvlp
function glazyMultipleFinishSiblings(&$glazyMultiple, $spacing = '')
{
    $count = count($glazyMultiple['elements']);
    $i = 0;
    foreach ($glazyMultiple['elements'] as $preparedElement) {
        glazyElement($preparedElement[0], burntCheck($preparedElement[1]), burntCheck($preparedElement[2]));
        //call_user_func_array('glazyElement', $preparedElement);
        $i++;
        if ($i < $count) {
            echo $spacing;
        }
    }
}
예제 #3
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);
예제 #4
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);
}
예제 #5
0
    glazyAttribute('content', PVLP_FACEBOOK_PAGE_ID);
    ?>
>
<?php 
}
//$canonicalURL = pvlpGetCanonicalURL();
if (false && !empty($canonicalURL)) {
    ?>
<link rel="canonical"<?php 
    glazyAttribute('href', $canonicalURL);
    ?>
>
<?php 
}
if (defined('PVLP_SITE_DESCRIPTION')) {
    glazyElement(array('tagName' => 'meta', 'name' => 'description', 'content' => PVLP_SITE_DESCRIPTION));
}
stirring('header', 'start');
wp_head();
stirring('header', 'wp_head');
if (defined('PVLP_ENABLE_TYPEKIT') && PVLP_ENABLE_TYPEKIT) {
    pvlpDisplayTypekitScripts();
}
if (PVLP_SITE_IS_REAL) {
    pvlpDisplayGoogleAnalyticsTracking();
} else {
    // _gaq variable is still created so added analytics info can be debugged.
    ?>
<script>
var _gaq = [];
</script>
예제 #6
0
 public function displayCopyright()
 {
     if (defined('PVLP_COPYRIGHT_MESSAGE')) {
         glazyElement('h6.copyright', PVLP_COPYRIGHT_MESSAGE);
     }
 }
예제 #7
0
function glazyPrintR($object)
{
    glazyElement('pre', print_r($object, true));
}