function mwidget_content($id) { $content = MObject::get('content', $id); $title_addon = $content->get_meta('title-addon'); if ($content) { ?> <h2 class="featurette-heading"><?php MPut::_html($content->get_title()); ?> <?php if ($title_addon) { ?> <br /> <span class="text-muted"><?php ' ' . MPut::_html($title_addon->get_value()); ?> </span> <?php } ?> </h2> <p class="lead"><?php MPut::_text($content->get_text()); ?> </p> <?php } }
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 }
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 } }
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 }
?> <option value="<?php MPut::_id($license->id); ?> " selected="selected"><?php MPut::_html($license->title); ?> </option> <?php } else { ?> <option value="<?php MPut::_id($license->id); ?> "><?php MPut::_html($license->title); ?> </option> <?php } ?> <?php } ?> <?php } ?> </select> </div> </div> </div>
<li><a href="index.php?module=muser&task=user_list">Users list <span class="glyphicon glyphicon-user"></span></a></li> <li><a href="index.php?module=muser&task=user_add">Add new user <span class="glyphicon glyphicon-plus"></span></a></li> <li class="divider"></li> <li><a href="index.php?module=preferences">Preferences <span class="glyphicon glyphicon-cog"></span></a></li> <li class="divider"></li> <?php } ?> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php MPut::_html(MAuth::user()); ?> <span class="caret"></span></a> <ul class="dropdown-menu"> <li> <a href="index.php?module=profile"> Profile <span class="glyphicon glyphicon-user"></span> </a> </li> <li> <a href="javascript:void(0)" onclick="$( '#logout-form' ).submit();"> <form action="index.php?module=login" method="post" id="logout-form"> <input type="hidden" name="do-logout" value="1" /> Logout <span class="glyphicon glyphicon-off"></span> </form> </a>
<p> <span class="badge">Created</span> <?php MPut::_html($data->created['when']); ?> <small>by <?php MPut::_html($data->created['by_user']); ?> </small> </p> <p> <span class="badge">Modified</span> <?php MPut::_html($data->modified['when']); ?> <small>by <?php MPut::_html($data->modified['by_user']); ?> </small> </p> </blockquote> </div> </div> <div class="col-xs-12 col-sm-12 col-md-4 col-lg-3"> <br /> <div class="panel panel-default"> <div class="panel-heading">Status</div> <div class="panel-body"> <input type="checkbox" name="category_enabled" id="category_enabled" <?php if (1 == $data->enabled) {
function mwidget_breadcrumbs() { ?> <ol class="breadcrumb"> <li><a href="index.php">Home</a></li> <?php if ('category' == $_GET['module']) { //category oldal if (!empty($_GET['object']) || !is_numeric($_GET['object'])) { $category = new M_Category(intval($_GET['object'])); ?> <li><a href="index.php?module=category&object=<?php MPut::_html($category->get_id()); ?> "><?php MPut::_html($category->get_title()); ?> </a></li> <?php } } else { if ('content' == $_GET['module']) { //content oldal if (!empty($_GET['object']) || !is_numeric($_GET['object'])) { $content = MObject::get('content', intval($_GET['object'])); if ($content && $content->get_id()) { $categories = ORM::for_table('categories')->where_like('contents', '%{' . intval($_GET['object']) . '}%')->find_many(); ?> <li> <?php $i = 1; foreach ($categories as $cat) { ?> <a href="index.php?module=category&object=<?php MPut::_html($cat->id); ?> "><?php MPut::_html($cat->title); ?> </a> <?php if ($i < sizeof($categories)) { echo ", "; } $i++; } ?> </li> <li><a href="index.php?module=content&object=<?php MPut::_html($content->get_id()); ?> "><?php MPut::_html($content->get_title()); ?> </a></li> <?php } } } } ?> </ol> <?php }
<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 /> <label>Task</label> <input type="text" name="module_task" class="form-control input-sm" />
static function content_props($content) { $created = $content->created(); ?> <div class="content-data"> <img src="media/images/avatar.png" style="height: 42px; position: relative; top: -8px;" /> <div style="display: inline-block; font-size: 10pt;"> <?php if (isset($created['by_name'])) { ?> <span itemprop="author"><?php MPut::_html($created['by_name']); ?> </span>, <?php } ?> <?php if (isset($created['when'])) { ?> <br /> <span itemprop="datePublished"><?php MPut::_html($created['when']); ?> </span> <?php } ?> </div> </div> <?php }
echo date_format(new DateTime($record['end_time']), 'Y-m-d H:i:s'); ?> <input type="hidden" name="content_end" value="<?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
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 } } }
?> <option value="<?php MPut::_numeric($group->id); ?> " selected="selected"><?php MPut::_html($group->title); ?> </option> <?php } else { ?> <option value="<?php MPut::_numeric($group->id); ?> "><?php MPut::_html($group->title); ?> </option> <?php } ?> <?php } ?> </select> </div> </div> <br /> <br />
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 } } }
static function put_data($data) { MPut::_html($data); }
<!DOCTYPE html> <html lang="it"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php 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');
<?php } ?> <select name="page_menu" class="form-control input-sm" id="page_menu"> <?php if (sizeof($menus) > 0) { ?> <?php foreach ($menus as $menu) { ?> <option value="<?php MPut::_id($menu->id); ?> "><?php MPut::_html($menu->title); ?> </option> <?php } ?> <?php } ?> </select> <br /> <button type="button" class="btn btn-sm" onclick="new MPage().add_menu();">Add</button> </div> </div>
</div> </div> <?php //var_dump($contents); die(); if (sizeof($contents) > 0) { foreach ($contents as $content) { $text_wrap = wordwrap(strip_tags($content->get_text()), 800, "%|%"); $text_array = explode('%|%', $text_wrap); ?> <div class="row main-header"> <div class="row content-title"> <div class="col-md-12"> <h3><?php MPut::_html($content->get_title()); ?> </h3> </div> </div> <div class="row content-text"> <div class="col-md-12"> <p><?php echo $text_array[0]; ?> ... </p> </div> </div> <div class="row content-text"> <div class="col-md-12"> <a href="index.php?module=content&object=<?php