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 } }
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 } } } }
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 ' | '; } ?> <?php } } } }
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 } }
<h4>Installed modules</h4> <?php MHTML::list_group($data['installed'], 'title', array('Disable' => 'new MModule().disable( \'*[id]\' );', 'Enable' => 'new MModule().enable( \'*[id]\' );')); ?> <?php } ?> <?php if (sizeof($forinstalls) > 0) { ?> <h4>Awaiting for install</h4> <?php MHTML::list_group($forinstalls, 'title', array('Install' => 'new MModule().install( \'*[name]\' );')); ?> <?php } ?> <input type="hidden" name="mapi_csrf" id="mapi_csrf" value="<?php MPut::_html_attr(mapi_csrf_value()); ?> " /> </form>
</div> <div class="panel panel-default"> <div class="panel-heading">Coords</div> <div class="panel-body"> <div class="form-group"> <label>Latitude</label> <input type="text" name="content_lat" class="form-control input-sm" id="content_lat" value="<?php MPut::_html_attr($coords['lat']); ?> " /> </div> <div class="form-group"> <label>Longitude</label> <input type="text" name="content_lng" class="form-control input-sm" id="content_lng" value="<?php MPut::_html_attr($coords['lng']); ?> " /> </div> </div> </div> <div class="btn-group"> <button type="submit" id="btn_add" class="btn btn-primary" name="content_add" onclick="new MContent().type_select();">Add</button> </div> </div> </div> </div> </div>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-9"> <br /> <div class="input-group"> <span class="input-group-addon">Title</span> <input type="text" name="page_title" class="form-control" id="page_title" value="<?php MPut::_html_attr($data->title); ?> " /> </div> <br /> <div class="input-group"> <span class="input-group-addon">URL</span> <input type="text" name="page_url" class="form-control" id="page_url" value="<?php MPut::_html_attr($data->url); ?> " /> </div> <ul class="nav nav-pills"> <li><a href="#" data-toggle="modal" data-target="#content-chooser"><span class="glyphicon glyphicon-list"></span> Add content</a></li> <li><a href="#" data-toggle="modal" data-target="#category-chooser"><span class="glyphicon glyphicon-list-alt"></span> Add category</a></li> <li><a href="#" data-toggle="modal" data-target="#module-chooser"><span class="glyphicon glyphicon-hdd"></span> Add module</a></li> </ul> </div> <div class="col-xs-12 col-sm-12 col-md-4 col-lg-3"> <br /> <div class="panel panel-default">
<br /> <div class="panel panel-default"> <div class="panel-heading">Coords</div> <div class="panel-body"> <div class="form-group"> <label>Latitude</label> <input type="text" name="content_lat" class="form-control input-sm" id="content_lat" value="<?php MPut::_html_attr($data->lat); ?> " /> </div> <div class="form-group"> <label>Longitude</label> <input type="text" name="content_lng" class="form-control input-sm" id="content_lng" value="<?php MPut::_html_attr($data->lng); ?> " /> </div> </div> </div> </div> </div> </div> <div class="tab-pane" id="meta"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-8 col-lg-9">
static function display_event($event) { ?> <div itemscope itemtype="http://schema.org/Event"> <h1 class="content-title"><span itemprop="name"><?php MPut::_html($event->get_title()); ?> </span></h1> <?php self::content_props($event); ?> <div class="content-text" itemprop="description"> <div class="content-dates"> <meta itemprop="startDate" content="<?php MPut::_html_attr(date_format(new Datetime($event->get_start()), 'Y-m-dTH:i')); ?> "> <meta itemprop="endDate" content="<?php MPut::_html_attr(date_format(new Datetime($event->get_end()), 'Y-m-dTH:i')); ?> "> <h5> <span class="glyphicon glyphicon-circle-arrow-right"></span> <?php MPut::_html_attr(date_format(new Datetime($event->get_start()), 'Y-m-d H:i')); ?> <span class="glyphicon glyphicon-circle-arrow-left"></span> <?php MPut::_html_attr(date_format(new Datetime($event->get_end()), 'Y-m-d H:i')); ?> </h5> </div> <?php MPut::_text($event->get_text()); ?> </div> <div style="clear: both;"></div> <?php self::content_location($event); ?> </div> <?php }
echo date_format(new DateTime($record['end_time']), 'Y-m-d H:i:s'); ?> " /> <?php } ?> </small> <p style="margin-top: 12px;"> <?php if (isset($record['description'])) { ?> <?php MPut::_html($record['description']); ?> <input type="hidden" name="content_text" value="<?php MPut::_html_attr($record['description']); ?> " /> <?php } ?> </p> </footer> </blockquote> <input type="hidden" name="mapi_csrf" id="mapi_csrf" value="" /> </form> </li> <?php } ?> <?php
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 } } }
<h4 class="modal-title">URL editor</h4> </div> <div class="modal-body"> <p class="text-info">Choose module:</p> <label>Module</label> <select name="module_name" class="form-control input-sm"> <?php if (sizeof($modules) > 0) { ?> <?php foreach ($modules as $module) { ?> <option value="<?php MPut::_html_attr($module->name); ?> "><?php MPut::_html($module->title); ?> </option> <?php } ?> <?php } ?> </select> <br />