Esempio n. 1
0
function mwidget_dividedmenu($menu_id, $class = null, $id = null)
{
    $menu = MObject::get('menu', $menu_id);
    if ($class) {
        $class = ' class="' . MPut::html_attr($class) . '"';
    } else {
        $class = '';
    }
    if ($id) {
        $id = ' id="' . MPut::html_attr($id) . '"';
    } else {
        $id = '';
    }
    if ($menu) {
        $pages = $menu->get_pages();
        if (sizeof($pages) > 0) {
            foreach ($pages as $page) {
                ?>
										<div<?php 
                echo $class . $id;
                ?>
 style="position: relative;">
												<a href="<?php 
                MPut::_link($page->get_url());
                ?>
" title="<?php 
                MPut::_html_attr($page->get_title());
                ?>
">
														<?php 
                //MPut::_html( $page->get_title() );
                ?>
														<?php 
                __($page->get_title());
                ?>
												</a>
											<div style="display:none;background-color:#000;min-width:100%;position:absolute; left: 0px; top: 20px;text-align: center;z-index: 9999;" >
												<?php 
                M_Template::widget('dropdownmenu', $page->get_title());
                ?>
											</div>
										</div>
										<div class="visible-xs col-xs-3"></div>
										<div class="visible-xs col-xs-6">
											<?php 
                M_Template::widget('dropdownmenu', $page->get_title());
                ?>
										</div>
										<div class="visible-xs col-xs-3"></div>
								<?php 
            }
        }
    }
}
Esempio n. 2
0
function mwidget_bottommenu($menu_id, $class = null, $id = null)
{
    $menu = MObject::get('menu', $menu_id);
    if ($class) {
        $class = ' class="' . MPut::html_attr($class) . '"';
    } else {
        $class = '';
    }
    if ($id) {
        $id = ' id="' . MPut::html_attr($id) . '"';
    } else {
        $id = '';
    }
    if ($menu) {
        $pages = $menu->get_pages();
        $size = sizeof($pages);
        if ($size > 0) {
            $i = 0;
            foreach ($pages as $page) {
                $i++;
                ?>
										<a href="<?php 
                MPut::_link($page->get_url());
                ?>
" title="<?php 
                MPut::_html_attr($page->get_title());
                ?>
">
												<?php 
                //MPut::_html( $page->get_title() );
                ?>
												<?php 
                __($page->get_title());
                ?>
										</a>
										<?php 
                if ($i != $size) {
                    echo '&nbsp;|&nbsp;';
                }
                ?>
								<?php 
            }
        }
    }
}
Esempio n. 3
0
 static function link($a, $link, $title = null, $onclick = null)
 {
     $title = '';
     if ($title && strlen($title) > 0) {
         $title = ' title="' . MPut::html_attr($title) . '"';
     }
     echo '<a href="' . MPut::link($link) . '"' . $title . '>' . MPut::html($a) . '</a>';
 }
Esempio n. 4
0
 public function meta()
 {
     if (is_array($this->page_meta) && sizeof($this->page_meta) > 0) {
         foreach ($this->page_meta as $key => $value) {
             echo '<meta name="' . MPut::html_attr($key) . '" content="' . MPut::html_attr($value) . '" />' . "\n\t";
         }
     }
 }
Esempio n. 5
0
function mwidget_menu($menu_id, $class = null, $id = null)
{
    $menu = MObject::get('menu', $menu_id);
    if ($class) {
        $class = ' class="' . MPut::html_attr($class) . '"';
    } else {
        $class = '';
    }
    if ($id) {
        $id = ' id="' . MPut::html_attr($id) . '"';
    } else {
        $id = '';
    }
    if ($menu) {
        $pages = $menu->get_pages();
        if (sizeof($pages) > 0) {
            $ContentEnabled = NULL;
            ?>
								<ul<?php 
            echo $class;
            echo $id;
            ?>
>
										<?php 
            foreach ($pages as $page) {
                ?>
												<?php 
                $TheLink = $page->get_url();
                $ContentID = substr(strrchr($TheLink, '='), 1);
                if ($ContentID > 0) {
                    $content = MObject::get('content', intval($ContentID));
                    if (is_object($content)) {
                        $ContentEnabled = $content->is_enabled();
                    } else {
                        $content = MObject::get('category', intval($ContentID));
                        $ContentEnabled = $content->is_enabled();
                    }
                } else {
                    $ContentEnabled = 1;
                }
                if (strrpos($TheLink, '/', 8)) {
                    $TheLinkRoot = substr($TheLink, 0, strrpos($TheLink, '/', 8));
                } else {
                    $TheLinkRoot = $TheLink;
                }
                $TheServerRoot = str_replace("/manager", "", rtrim(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']), '/\\'));
                $TheRealLink = str_replace($TheLinkRoot, $TheServerRoot, $TheLink);
                ?>
												<?php 
                if ($page->is_enabled() == 1 && $ContentEnabled == 1) {
                    ?>
												<?php 
                    if ($page->page_on_blank() == TRUE) {
                        $TargetString = '_blank';
                    } else {
                        $TargetString = '_self';
                    }
                    ?>
														<li>

																<a href="<?php 
                    echo $TheRealLink;
                    //MPut::_link( $page->get_url() );
                    ?>
" target="<?php 
                    echo $TargetString;
                    ?>
" title="<?php 
                    MPut::_html_attr($page->get_title());
                    ?>
">
																		<?php 
                    MPut::_html($page->get_title());
                    ?>
																</a>
														</li>
												<?php 
                }
                ?>
										<?php 
            }
            ?>
								</ul>
						<?php 
        }
    }
}