Ejemplo n.º 1
0
    if ($action == 'online' && dyn::get('user')->hasPerm('page[edit]')) {
        $sql = sql::factory();
        $sql->query('SELECT online FROM ' . sql::table('structure') . ' WHERE id=' . $id)->result();
        $online = $sql->get('online') ? 0 : 1;
        $sql->setTable('structure');
        $sql->setWhere('id=' . $id);
        $sql->addPost('online', $online);
        $sql->update();
        echo message::success(lang::get('save_status'));
        $action = '';
    }
    if ($action == '') {
        if (ajax::is()) {
            echo pageMisc::getTreeStructurePage();
            exit;
        }
        $button = [];
        if (dyn::get('user')->hasPerm('page[edit]')) {
            $button = ['<a class="btn btn-sm btn-default" href="' . url::backend('structure', ['subpage' => 'pages', 'action' => 'add']) . '">' . lang::get('add') . '</a>'];
        }
        ?>
	<div class="row" id="structure-body"><?php 
        echo bootstrap::panel(lang::get('pages'), $button, pageMisc::getTreeStructurePage());
        ?>
</div>
	<?php 
        if (dyn::get('user')->hasPerm('page[edit]')) {
            layout::addJs("layout/js/structureSort.js");
        }
    }
}
Ejemplo n.º 2
0
        if (dyn::get('user')->hasPerm('page[edit]')) {
            ?>
					<div class="btn-group pull-right">
						<a class="btn btn-sm btn-default" href="<?php 
            echo url::backend('structure', ['subpage' => 'pages', 'action' => 'add']);
            ?>
"><?php 
            echo lang::get('add');
            ?>
</a>
					</div>
                    <?php 
        }
        ?>
					<div class="clearfix"></div>
				</div>
				<div class="panel-body">
				<?php 
        echo pageMisc::getTreeStructurePage();
        ?>
				</div>
			</div>
		</div>
	</div>
	
	<?php 
        if (dyn::get('user')->hasPerm('page[edit]')) {
            layout::addJs("layout/js/structureSort.js");
        }
    }
}