示例#1
0
"><?php 
ra_lang('Ask Questions');
?>
</a>			
			
			<?php 
echo ra_nav($context->content, 'main-menu nav navbar-nav', true);
?>
			
			
      </div>
    </div>
	

	<?php 
if (ra_edit_mode() && ra_is_admin()) {
    include DUDE_THEME_DIR . '/inc/builder_elm.php';
}
?>

	<section id="main" <?php 
echo qa_opt('ra_nav_fixed') ? ' class="has-fixed-top"' : '';
?>
>
		<?php 
global $ra_error;
if (isset($context->content['error']) && strlen($context->content['error']) > 0 || isset($ra_error)) {
    ?>
			<div id="ra-alert" class="alert fade in">
				<button aria-hidden="true" data-dismiss="alert" class="close" type="button">&times;</button>	
				<?php 
示例#2
0
function ra_layout_cache($page)
{
    $file = DUDE_THEME_DIR . '/cache/' . $page . '.php';
    ob_start();
    //if in builder mode load from database
    if (ra_edit_mode() && ra_is_admin()) {
        if (file_exists($file)) {
            unlink($file);
        }
        return ra_db_builder($page);
    }
    // check if the cache file already exists
    if (file_exists($file)) {
        include $file;
    } else {
        $html = ra_db_builder($page);
        if (strlen($html)) {
            $dom = new DOMDocument();
            $dom->loadHTML('<?xml encoding="UTF-8">' . $html);
            $xpath = new DOMXPath($dom);
            $pDivs = $xpath->query(".//div[@class='config']");
            foreach ($pDivs as $div) {
                $div->parentNode->removeChild($div);
            }
            file_put_contents($file, builder_innerHTML($dom->documentElement->firstChild));
            include $file;
        } else {
            file_put_contents($file, '<h2 style="text-align:center">The layout of this page was not built before, please build the layout using builder.</h2>');
            include $file;
        }
    }
    $output = ob_get_clean();
    return $output;
}
示例#3
0
    function sc_ra_user_compact()
    {
        if (qw_hook_exist(__FUNCTION__)) {
            $args = func_get_args();
            array_unshift($args, $this);
            return qw_event_hook(__FUNCTION__, $args, NULL);
        }
        $handle = explode('/', qa_request());
        $handle = $handle[1];
        ob_start();
        ?>
			<div class="user-compact">
			<div class="user-info clearfix">
				<div class="avatar pull-left">
					<?php 
        echo ra_get_avatar($handle, 40);
        ?>
				</div>	
				<div class="name-point">
					<h5><?php 
        echo $handle;
        ?>
</h5>
					<span class="points"><?php 
        echo ra_user_points($handle);
        ?>
</span>
				</div>
			</div>
			<ul class="user-list-menu">
				<?php 
        if (ra_is_admin()) {
            echo '<li class="edit-profile-link"><a id="edit-user" class="btn btn-xs btn-success edit-profile icon-edit" href="' . qa_path_absolute('user/' . $handle, array('state' => 'edit')) . '">Edit User</a></li>';
        }
        foreach ($this->content['navigation']['sub'] as $k => $nav) {
            if ($k != 'wall') {
                echo '<li><a href="' . @$nav['url'] . '">' . @$nav['label'] . '</a></li>';
            }
        }
        ?>
			</ul>
			</div>
			<?php 
        $this->output(ob_get_clean());
    }
示例#4
0
        if (isset($a['url'])) {
            $icon = isset($a['icon']) ? ' class="' . $a['icon'] . '" ' : '';
            echo '<li' . (isset($a['selected']) ? ' class="active"' : '') . '><a' . $icon . ' href="' . @$a['url'] . '" title="' . @$a['label'] . '">' . @$a['label'] . '</a></li>';
        }
    }
    if (!isset($context->content['navigation']['user']['logout']['url'])) {
        echo '<li>' . $context->content['navigation']['user']['logout']['label'] . '</li>';
    }
    ?>
					</ul>
				</div>
			</li>
		</ul>

		<?php 
    if (ra_is_admin() && $context->template != 'admin') {
        ?>
			<ul class="nav-userbox nav pull-right">
				<li class="dropdown" id="menuLogin">
					<a class="site-tools dropdown-toggle" data-toggle="dropdown" href="#">
						<i class="icon-wrench"></i>
					</a>
					
					<div class="dropdown-menu">	
						<ul class="user-nav">
						<?php 
        $admin_link = $context->content['navigation']['main']['admin'];
        if (isset($admin_link)) {
            ?>
							<li <?php 
            echo isset($admin_link['selected']) ? ' class="active"' : '';