Esempio n. 1
0
function mwidget_intro()
{
    global $content;
    if (!is_object($content)) {
        return null;
    }
    $img = $content->get_media(true);
    if (!is_object($img)) {
        $img = $content->get_media();
    }
    if (is_array($img)) {
        reset($img);
        $img = current($img);
    }
    if (!is_object($img)) {
        $img = new stdClass();
        $img->url = mapi_install_url() . 'media/default_content.jpg';
    }
    ?>
				<div class="introimage" style="background-image: url( '<?php 
    MPut::_link($img->url);
    ?>
' );">
						&nbsp;
				</div>
		<?php 
}
Esempio n. 2
0
    static function breadcrumb($crumbs)
    {
        if (!is_array($crumbs) || !sizeof($crumbs) > 0) {
            return null;
        }
        ?>

						<div class="m-content-breadcrumb">
								<ol class="breadcrumb mapi-manager-breadcrumb">
										<?php 
        if (defined('ENV') && 'manager' == ENV) {
            ?>
												<li><a href="index.php">Dashboard</a></li>
										<?php 
        } else {
            ?>
												<li><a href="index.php">Home</a></li>
										<?php 
        }
        ?>
										
										<?php 
        foreach ($crumbs as $crumb) {
            ?>
												<?php 
            if (isset($crumb['title'])) {
                ?>
														<?php 
                if (isset($crumb['link'])) {
                    ?>
																<li><a href="<?php 
                    MPut::_link($crumb['link']);
                    ?>
"><?php 
                    MPut::_html($crumb['title']);
                    ?>
</a></li>
														<?php 
                } else {
                    ?>
																<li><?php 
                    MPut::_html($crumb['title']);
                    ?>
</li>
														<?php 
                }
                ?>
												<?php 
            }
            ?>
										<?php 
        }
        ?>
								</ol>
						</div>

				<?php 
    }
Esempio n. 3
0
function mwidget_dropdownmenu($menu_item)
{
    $menu_item = strtolower($menu_item);
    switch ($menu_item) {
        case "associarsi":
            $menu_id = 5;
            break;
        case "chi siamo":
            $menu_id = 6;
            break;
        case "eventi":
            $menu_id = 7;
            break;
        case "attivita'":
            $menu_id = 8;
            break;
        default:
            $menu_id = null;
            break;
    }
    $menu = MObject::get('menu', $menu_id);
    if ($menu) {
        $pages = $menu->get_pages();
        ?>
				<ul style="margin:0;">
				<?php 
        if (sizeof($pages) > 0) {
            foreach ($pages as $page) {
                ?>
										<div style="position: relative; margin:6px; text-align:left;">
												<li style="white-space:nowrap;">
												<a href="<?php 
                MPut::_link($page->get_url());
                ?>
" title="<?php 
                MPut::_html_attr($page->get_title());
                ?>
" style="margin: 6px 0; font-size: 13px;">
														<?php 
                //MPut::_html( $page->get_title() );
                ?>
														<?php 
                __($page->get_title());
                ?>
												</a>
												</li>
										</div>
								<?php 
            }
        }
        ?>
				</ul>
				<?php 
    }
}
Esempio n. 4
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. 5
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. 6
0
function mwidget_content_market($id)
{
    $content = MObject::get('content', $id);
    if ($content) {
        $img = mapi_get_default_media($content->get_id(), 'failover');
        ?>
						<?php 
        if (isset($img['url'])) {
            ?>
								<img class="img-circle" src="<?php 
            MPut::_link($img['url']);
            ?>
" alt="<?php 
            MPut::_html_attr($img['title']);
            ?>
" style="width: 140px; height: 140px;">
						<?php 
        } else {
            ?>
								<img class="img-circle" data-src="holder.js/140x140" alt="Generic placeholder image">
						<?php 
        }
        ?>

	                    <a href="index.php?module=content&object=<?php 
        MPut::_id($content->get_id());
        ?>
" title="<?php 
        MPut::_html_attr($content->get_title());
        ?>
">
	                    		<h2><?php 
        MPut::_html($content->get_title());
        ?>
</h2>
	                    </a>
	                    <p><?php 
        echo mapi_short_description($content->get_text(), 5);
        ?>
</p>
				<?php 
    }
}
Esempio n. 7
0
function mwidget_box($image, $title, $desc, $link)
{
    ?>
<div class="enterleave col-sm-4 col-xs-12" style="cursor: pointer; margin: 16px 0;"
<?php 
    if (!empty($link)) {
        echo 'onclick="window.open(\'' . MPut::link($link) . '\', \'_blank\');"';
    }
    ?>
>
						<img src="<?php 
    if (!empty($image)) {
        MPut::_link($image);
    }
    ?>
" />
						<div class="img-caption">
								<div class="row">
										<div class="col-md-12" style="color: #fff;">
												<h2 class="img-caption-text"><?php 
    if (!empty($title)) {
        MPut::_html($title);
    }
    ?>
</h2>
												<div class="hidden-sm img-caption-text"><?php 
    if (!empty($desc)) {
        MPut::_html($desc);
    }
    ?>
</div>
										</div>
								</div>
						</div>
				</div>
		<?php 
}
Esempio n. 8
0
<ul class="list-group">
		<li class="list-group-item">
				<h4 class="list-group-item-heading">Facebook events</h4>
				<p class="list-group-item-text">
						<form id="import_facebook_form" method="post">
								<input type="hidden" name="import_begin" value="1" />
								<input type="hidden" name="import_what" value="facebook" />
								<?php 
if (empty($appid) || empty($secret)) {
    ?>
										<a href="javascript:void(0)"><span style="text-decoration: line-through;">Import</span></a>
										&nbsp;<small>(Please set facebook appid and secret in <a href="index.php?module=preferences">preferences</a>)</small>
								<?php 
} elseif ($facebook_instance->getUser()) {
    ?>
										<a href="javascript:void(0)" onclick="$( '#import_facebook_form' ).submit();">Import</a>
								<?php 
} else {
    ?>
										<a href="javascript:void(0)"><span style="text-decoration: line-through;">Import</span></a>
										&nbsp;<small>(Please login to Your <a href="<?php 
    MPut::_link($facebook_login_link);
    ?>
">facebook account</a> first)</small>
								<?php 
}
?>
						</fomr>
				</p>
		</li>
</ul>
Esempio n. 9
0
MPut::_html($this->page_title);
?>
</title>
		<?php 
$this->meta();
?>

		

		<?php 
$this->output_assets('css');
?>
        <link href='http://fonts.googleapis.com/css?family=Courgette&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
        <link href="<?php 
MPut::_link($this->get_dir());
?>
/css/style.css" rel="stylesheet">
        <link href="<?php 
MPut::_link($this->get_dir());
?>
/css/responsive.css" rel="stylesheet">

        <?php 
$this->output_assets('js');
?>

		<!--[if lt IE 9]>
		<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
		<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
</head>
Esempio n. 10
0
function mwidget_slider($slider_id)
{
    $sid = intval($slider_id);
    if ($sid) {
        $contents = array();
        $category = MObject::get('category', $sid);
        if ($category && $category->get_id()) {
            $contents = $category->get_contents();
        }
        $filtered_contents = array();
        $language = new M_Language();
        $lang = $language->getLanguage();
        //var_dump($contents);die();
        if (sizeof($contents) > 0) {
            foreach ($contents as $content) {
                if ($lang == $content->get_language()) {
                    $filtered_contents[] = $content;
                }
            }
            $filtered = false;
            if (sizeof($filtered_contents) > 0) {
                $contents = $filtered_contents;
                $filtered = true;
            }
            ?>
								<div id="carousel-captions" class="carousel slide" data-ride="carousel">
										<ol class="carousel-indicators">
												<?php 
            $k = 0;
            foreach ($contents as $content) {
                ?>
												<li data-target="#carousel-captions" data-slide-to="<?php 
                echo $k;
                ?>
" class="<?php 
                if (0 == $k) {
                    echo "active";
                }
                ?>
"></li>
												<?php 
                $k++;
            }
            ?>
										</ol>
										<div class="carousel-inner">
						<?php 
            $i = 0;
            foreach ($contents as $content) {
                if ($filtered && 3 == $i) {
                    break;
                }
                $slide = $content->get_media(true);
                if (!is_object($slide)) {
                    $slide = $content->get_media();
                }
                if (is_array($slide)) {
                    reset($slide);
                    $slide = current($slide);
                }
                if (!is_object($slide)) {
                    $slide = new stdClass();
                    $slide->url = mapi_install_url() . 'media/default_slider.jpg';
                }
                ?>
										<div class="item<?php 
                if (0 == $i) {
                    echo ' active';
                }
                ?>
" style="cursor: pointer;" onclick="location.href='index.php?module=content&object=<?php 
                echo intval($content->get_id());
                ?>
'">
												<img class="carousel-image" src="<?php 
                MPut::_link($slide->url);
                ?>
" style="width: 100%;">
												<div class="carousel-caption">
									<h3 class="hidden-xs hidden-sm"><?php 
                MPut::_html($content->get_title());
                ?>
</h3>
									<h4 class="hidden-md hidden-lg"><?php 
                MPut::_html($content->get_title());
                ?>
</h4>
														<p class="hidden-xs hidden-sm"><?php 
                echo mapi_short_description($content->get_text(), 1);
                ?>
</p>
														
												</div>
												<?php 
                $hashtag = $content->get_meta('slide-hashtag');
                if ($hashtag->get_value()) {
                    ?>
																		<a class="carousel-red-label">
																				#<?php 
                    MPut::_html($hashtag->get_value());
                    ?>
																		</a>
																<?php 
                }
                ?>
										</div>
								<?php 
                $i++;
            }
            ?>
								</div>
								<a class="left carousel-control" href="#carousel-captions" data-slide="prev">
										<span class="glyphicon glyphicon-chevron-left"></span>
								</a>
								<a class="right carousel-control" href="#carousel-captions" data-slide="next">
										<span class="glyphicon glyphicon-chevron-right"></span>
								</a>
						<?php 
        }
    }
}