Exemple #1
0
 /**
  * Customize the menu
  */
 public function index()
 {
     $items = MenuItem::getAll();
     $form = new Form(array('id' => 'set-menus-form', 'action' => App::router()->getUri('set-menu'), 'inputs' => array(new HiddenInput(array('name' => 'data', 'default' => json_encode($items, JSON_NUMERIC_CHECK), 'attributes' => array('e-value' => 'JSON.stringify(items.valueOf())'))), new SubmitInput(array('name' => 'valid', 'value' => Lang::get('main.valid-button')))), 'onsuccess' => 'app.refreshMenu()'));
     if (!$form->submitted()) {
         $this->addKeysToJavaScript($this->_plugin . '.plugins-advert-menu-changed');
         return View::make(Plugin::current()->getView('sort-main-menu.tpl'), array('form' => $form));
     } else {
         try {
             $items = MenuItem::getAll('id');
             $data = json_decode($form->getData('data'), true);
             foreach ($data as $line) {
                 $item = $items[$line['id']];
                 $item->set(array('active' => $line['active'], 'parentId' => $line['parentId'], 'order' => $line['order']));
                 $item->save();
             }
             return $form->response(Form::STATUS_SUCCESS, Lang::get($this->_plugin . '.sort-menu-success'));
         } catch (Exception $e) {
             return $form->response(Form::STATUS_ERROR, DEBUG_MODE ? $e->getMessage() : Lang::get($this->_plugin . '.sort-menu-error'));
         }
     }
 }
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$scope = getScope();
$menu = MenuItem::getAll("footer");
$hide_link = Setting::get("hide_socia_link") == "yes" ? true : false;
echo <<<HTML
<nav class="navbar navbar-inverse navbar-fixed-bottom">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<?php 
    echo getSiteURL();
    ?>
"><?php 
    echo getSiteName();
    ?>
</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <?php 
    echo MenuItem::getAll("header_left");
    echo Custompage::getMenuItems();
    ?>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <?php 
    echo MenuItem::getAll("header_right");
    ?>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    <?php 
}
echo display("navigation:after");
function getMenuItems($menu_name, $item_class = "", $parent = "ul", $child = "li", $child_wrapper = true)
{
    return MenuItem::getAll($menu_name, $item_class, $parent, $child, $child_wrapper);
}
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$guid = pageArray(1);
if (!$guid) {
    $guid = getLoggedInUserGuid();
}
$user = getEntity($guid);
$button = NULL;
$icon = $user->icon(EXTRALARGE, "img-responsive");
$extension = display("profile_owner_block_body");
$profile_menu = MenuItem::getAll("profile", "", "", "", NULL);
if ($guid == getLoggedInUserGuid()) {
    $button = "<a href='" . getSiteURL() . "editAvatar' class='btn btn-info edit_avatar_button'><i class='fa fa-pencil'></i></a>";
}
?>
<div class='panel panel-default'>
    <div class="panel-body">
        <div style='position:relative;' id='profile_avatar'>
            <?php 
echo $button;
?>
            <?php 
echo $icon;
?>
            <h2 class='text-center'><?php 
echo $user->full_name;