Example #1
0
function stab($tab_repeat = false)
{
    return wpiTemplate::spacing($tab_repeat);
}
Example #2
0
 public function embedScript()
 {
     global $wp_query;
     list($lang, $locale) = explode('-', get_bloginfo('language'));
     $pid = isset($wp_query->post->ID) ? $wp_query->post->ID : 0;
     $js = PHP_EOL . PHP_T;
     $js .= '/*<![CDATA[*/' . PHP_EOL . PHP_T . PHP_T;
     $js .= 'var wpi = {url:' . json_encode(WPI_URL_SLASHIT);
     $js .= ',id:' . json_encode(wpiTemplate::bodyID());
     $js .= ',blogname:' . json_encode(WPI_BLOG_NAME);
     $js .= ',theme_url:' . json_encode(WPI_THEME_URL);
     $js .= ',section:' . json_encode(is_at());
     $js .= ',permalink:' . json_encode(trailingslashit(self_uri()));
     $jspath = json_encode(rel(WPI_THEME_URL . 'public/scripts/'));
     $jsurl = json_encode(wpi_get_scripts_url('%s'));
     $js .= ',script:{path:' . $jspath . ',url:' . $jsurl . '}';
     if (wpi_option('client_time_styles')) {
         $js .= ',pid:' . $pid . ',cl_type:td};jQuery(document).ready(function(){if( $(\'#\'+wpi.id).hasClass(wpi.cl_type) == false){ $(\'#\'+wpi.id).addClass(wpi.cl_type);jQuery.cookie(\'wpi-cl\',wpi.cl_type,{duration: 1/24,path: "/"});};});' . PHP_EOL;
     } else {
         $js .= ',pid:' . $pid . '};' . PHP_EOL;
     }
     // check client cookie;
     if ($wp_query->is_search || $wp_query->is_404) {
         // google webmaster 404 widget
         $js .= PHP_T . PHP_T . 'var GOOG_FIXURL_LANG = \'' . $lang . '\';var GOOG_FIXURL_SITE = wpi.url;' . PHP_EOL;
     }
     $js .= PHP_T . '/*]]>*/' . PHP_EOL . PHP_T;
     echo PHP_T;
     t('script', $js, array('id' => 'wp-js-head-embed', 'type' => 'text/javascript', 'defer' => 'defer', 'charset' => 'utf-8'));
 }
Example #3
0
do_action(wpiFilter::ACTION_DOCUMENT_DTD);
?>
<html xmlns="http://www.w3.org/1999/xhtml" <?php 
language_attributes('xhtml');
?>
>
<head profile="http://www.w3.org/TR/grddl-primer/,http://purl.org/NET/erdf/profile,http://gmpg.org/xfn/11,http://dublincore.org/documents/dcq-html/">
<?php 
do_action('wp_head');
?>
</head><?php 
do_action(wpiFilter::ACTION_FLUSH);
?>

<body id="<?php 
echo wpiTemplate::bodyID();
?>
" class="<?php 
wpi_body_class();
?>
">
<dl id="page" class="hfeed r">
<?php 
wpi_section_start('nav');
do_action(wpiFilter::ACTION_TPL_HEADER);
?>
				<div id="search">
					<form method="get" id="searchform" action="<?php 
echo WPI_URL_SLASHIT;
?>
">		
Example #4
0
/**
 * WP log-in, log-out, register & admin dashboard links
 *  
 */
function wpi_acl_links()
{
    $m = array();
    $acl_links = array();
    $m['register'] = array();
    // sort first.
    $m['loginout'] = array('/wp-login.php', 'log-in', 'Log-in to ' . WPI_BLOG_NAME, 'Log-in');
    if (get_option('users_can_register')) {
        $m['register'] = array('/wp-login.php?action=register', 'registration-open', 'Register an Account', 'Register');
    } else {
        $m['register'] = array('/#' . wpiTemplate::bodyID(), 'registration-closed', 'Registration is Closed', 'Registration is Closed');
    }
    if (is_user_logged_in()) {
        $m['register'] = array('/wp-admin/', 'dashboard', WPI_BLOG_NAME . '&apos;s WP Admin Dashboard', 'Dashboard');
        $req_uri = get_req_url();
        $m['loginout'] = array('/wp-login.php?action=logout&amp;redirect_to=' . $req_uri, 'log-out', 'Log-out from ' . WPI_BLOG_NAME, 'Log-out');
    }
    foreach ($m as $k => $v) {
        // attributes
        $attribs = array();
        $attribs['id'] = $v[1];
        $attribs['href'] = rel(WPI_URL . $v[0]);
        if ($k == 'login') {
            $attribs['href'] = apply_filters($k, $attribs['href']);
        }
        $attribs['title'] = 'Info | ' . $v[2];
        if ($k != 'register') {
            $attribs['rel'] = 'noindex noarchive';
        }
        $attribs['rev'] = 'site:relative';
        $attribs['class'] = 'ttip';
        $acl_links[] = _t('a', $v[3], $attribs);
    }
    $output = "\n";
    if (is_array($acl_links)) {
        $cnt = 1;
        foreach ($acl_links as $link) {
            $output .= stab(4) . _t('li', $link, array('id' => 'acl-' . $cnt));
            $cnt++;
        }
    }
    t('ul', $output . stab(2) . PHP_T, array('id' => 'cl-options', 'class' => 'xoxo r cfl cf'));
}