Ejemplo n.º 1
0
 public function getMenu()
 {
     try {
         $admin_id = Tools::getAdminId();
         $menu_tree = SysMenu::getTreeByAdmin($admin_id);
         $re = Tools::reTrue('获取菜单成功', $menu_tree);
     } catch (Exception $e) {
         $re = Tools::reFalse($e->getCode(), '获取菜单失败:' . $e->getMessage());
     }
     return Response::json($re);
 }
Ejemplo n.º 2
0
 public static function getTreeByRole($role_id = 0)
 {
     $role = SysRole::find($role_id);
     if (empty($role)) {
         throw new Exception("没有查找到角色数据", 10001);
     }
     $list = SysMenu::select('sys_menus.*', 'sys_role_menus.r_id AS checked')->leftJoin('sys_role_menus', function ($q) use($role_id) {
         $q->on('sys_menus.id', '=', 'sys_role_menus.m_id')->where('sys_role_menus.r_id', '=', $role_id);
     })->groupBy('sys_menus.id')->get();
     $re = SysMenu::makeTree($list);
     return $re['tree'];
 }
Ejemplo n.º 3
0
<?php

$mod_name = "content";
require "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
$obj = new SysMenu();
$buildform = new BuildForm();
function art_publish($ids)
{
    global $dbcon;
    if (is_array($ids)) {
        $q1 = "update articletype set  usenav=0";
        $dbcon->execute($q1) or die($dbcon->errorMsg());
        //	for($v=0; $v<$count; $v++) {
        while (list($key, $value) = each($ids)) {
            $q = "update articletype set  usenav=1 where id={$key}";
            $dbcon->execute($q) or die($dbcon->errorMsg());
        }
        $qs = array('msg' => urlencode('Selected items posted as draft.'));
    }
    //send_to($_SERVER['PHP_SELF'], $qs);
}
function art_order($ids)
{
    global $dbcon;
    if (is_array($ids)) {
        $q1 = "update articletype set  textorder=0";
        $dbcon->execute($q1) or die($dbcon->errorMsg());
        //	for($v=0; $v<$count; $v++) {
        while (list($key, $value) = each($ids)) {
            //	echo $value."<br>";
Ejemplo n.º 4
0
 public function listRoleMenu($id)
 {
     try {
         $menu_tree = SysMenu::getTreeByRole($id);
         $re = Tools::reTrue('获取菜单成功', $menu_tree);
     } catch (Exception $e) {
         $re = Tools::reFalse($e->getCode(), '获取菜单失败:' . $e->getMessage());
     }
     return Response::json($re);
 }
Ejemplo n.º 5
0
    ?>
 >
                </em></div></td>
          </tr> <?php 
}
?>
          <tr> 
            <td align="center" class="name">&nbsp;</td>
            <td align="center">&nbsp;</td>
          </tr>
          <tr> 
            <td align="center" class="name"><div align="left">Related to Section</div></td>
            <td align="center"><div align="left">
                <select name="section">
                  <OPTION VALUE="<?php 
$obj = new SysMenu();
if ($_GET[id]) {
    $typelab = $dbcon->Execute("SELECT id, type FROM articletype where id = " . $calendaritems->Fields("section") . "") or die($dbcon->ErrorMsg());
    echo $typelab->Fields("id");
    ?>
" SELECTED><?php 
    echo $typelab->Fields("type");
    ?>
</option>
                  <?php 
}
echo $obj->select_type_tree(0);
?>
                </Select>
              </div></td>
          </tr>
Ejemplo n.º 6
0
<?php

$mod_name = 'content';
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
$obj = new SysMenu();
$allclass = $dbcon->Execute("SELECT distinct class.id, class.class FROM class left  join articles on articles.class =class.id where articles.id  is not null ORDER BY class ASC") or die($freedomrising->ErrorMsg());
$allclass_numRows = 0;
$allclass__totalRows = $allclass->RecordCount();
include "header.php";
?>
<table width="100%" border="0" align="center">
        <tr> 
          <td class="banner">Content</td>
        </tr>
        <tr> 
          <td><div align="left"> 
              <form action="article_list.php" method="post" name="form2" class="name">
                <strong>Search By </strong><br/>
                <input name="sid" type="text" id="id" value="ID" size="5" class="name">
                <input name="stitle" type="text" id="title" value="Title" size="25" class="name">
                <input name="sauthor" type="text" id="author" value="Author" size="20" class="name">
                <input name="sdate" type="text" value="Date (ex 01-12-02)" size="25" class="name">
                <input name="Search" type="submit" id="Search" value="Search" class="name">
                <br>
                Note: Search is based on the section that you are currently in. 
                To search all content please click &quot;All Content&quot; below 
                before you start your search. You may only search one field at 
                a time. 
              </form>
              <p style="margin-bottom: 1ex;"><a href="article_list.php"><strong><big>View All Content</big></strong></a></p>
Ejemplo n.º 7
0
<?php

$mod_name = "content";
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
require_once 'AMP/System/Upload.inc.php';
require_once 'AMP/Content/Image/Resize.inc.php';
require_once 'AMP/Content/Image/Display.inc.php';
$obj = new SysMenu();
$buildform = new BuildForm();
include "header.php";
#$getimgset=$dbcon->Execute("SELECT thumb, optw, optl FROM sysvar where id =1") or DIE($dbcon->ErrorMsg());
if ($_POST['MM_insert'] && isset($_FILES['file']['tmp_name']) && file_exists($_FILES['file']['tmp_name'])) {
    $upLoader =& new AMPSystem_Upload($_FILES['file']['name']);
    if (isset($_POST['newname']) && $_POST['newname']) {
        $upLoader->setTargetFileName($_POST['newname']);
    }
    $image_path = AMP_CONTENT_URL_IMAGES . AMP_IMAGE_CLASS_ORIGINAL;
    if ($upLoader->setFolder($image_path) && $upLoader->execute($_FILES['file']['tmp_name'])) {
        $new_file_name = basename($upLoader->getTargetPath());
        $reSizer =& new ContentImage_Resize();
        if (!($reSizer->setImageFile($upLoader->getTargetPath()) && $reSizer->execute())) {
            $result_message = "Resize failed:<BR>" . join("<BR>", $reSizer->getErrors()) . $result_message;
        } else {
            $imageDisplay =& new ContentImage_Display_allVersions($new_file_name);
            $result_message = $imageDisplay->execute();
        }
    } else {
        $result_message = "File Upload Failed<BR>\n" . join('<BR>', $upLoader->getErrors());
    }
    #$imnae2 = upload_image($_POST['newname'],$getimgset->Fields("optw"),$getimgset->Fields("optl"),$getimgset->Fields("thumb"));
Ejemplo n.º 8
0
<?php

$mod_name = 'content';
require "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
$obj = new SysMenu();
if (!AMP_Authorized(AMP_PERMISSION_CONTENT_EDIT)) {
    ampredirect("index.php");
}
/**
 * a function to take an array of IDs and set their publish status to 1
 */
function art_publish($ids)
{
    global $dbcon;
    if (is_array($ids)) {
        foreach ($ids as $id) {
            $q = "update articles set publish=1 where id={$id}";
            #die($q);
            $dbcon->execute($q) or die($q . $dbcon->errorMsg());
        }
        $qs = array('msg' => urlencode('Selected items posted live.'));
    }
    send_to($_SERVER['PHP_SELF'], $qs);
}
function art_order($ids)
{
    global $dbcon;
    if (is_array($ids)) {
        while (list($key, $value) = each($ids)) {
            $q = "update articles set  pageorder='{$value}' where id={$key}";
Ejemplo n.º 9
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSysMenus()
 {
     return $this->hasMany(SysMenu::className(), ['type_ID' => 'ID']);
 }
Ejemplo n.º 10
0
<?php

$mod_name = 'content';
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
require_once "AMP/Form/HTMLEditor.inc.php";
require_once "../includes/versionfunctions.php";
$buildform = new BuildForm();
$obj = new SysMenu();
/* 
 foreach ($_POST as $ps_key=>$ps_value) {
   print $ps_key.": ".$ps_value."<BR>";
 }
*/
if (!AMP_Authorized(AMP_PERMISSION_CONTENT_EDIT)) {
    ampredirect("index.php");
}
if (isset($_GET['preview'])) {
    ampredirect(AMP_URL_AddVars(AMP_CONTENT_URL_ARTICLE, array("id=" . $_GET['id'], "preview=1")));
}
ob_start();
if ($_GET['restore']) {
    articleversionrestore($_GET['restore']);
    $org_id = $_GET['id'];
    ampredirect("article_edit.php?id={$org_id}");
}
if ($_POST['MM_update'] && $_POST['MM_recordId'] or $_POST['MM_insert'] or $_POST['MM_delete'] && $_POST['MM_recordId']) {
    //set non POST passed varablies
    $userlookup = AMPSystem_Lookup::instance('users');
    $article = trim($_POST['article']);
    $_POST['updatedby'] = array_search($_SERVER['REMOTE_USER'], $userlookup);
Ejemplo n.º 11
0
<?php
$mod_name="content";
require_once("Connections/freedomrising.php"); 
require_once("Connections/sysmenu.class.php");
require_once ('AMP/Content/Section/Contents/Manager.inc.php');
require_once('AMP/Content/Lookups.inc.php');
require_once ('AMP/Content/Labels.inc.php');

// create Menu
$buildform = new BuildForm;
$obj = new SysMenu;

  // *** Edit Operations: declare Tables
  $MM_editAction = $PHP_SELF;
  if ($_SERVER['QUERY_STRING']) {
    $MM_editAction = $MM_editAction . "?" . $_SERVER['QUERY_STRING'];
  }

  $MM_abortEdit = 0;
  $MM_editQuery = "";
  ob_start();


  // *** Update Record: set variables
  
if ( ((isset($_REQUEST['MM_update'])) && (isset($_REQUEST['MM_recordId'])) ) or (isset($_REQUEST['MM_insert'])) or ((isset($_REQUEST['MM_delete'])) && (isset($_REQUEST['MM_recordId']))) )  {

	$getimgset=$dbcon->Execute("SELECT thumb, optw, optl FROM sysvar where id =1") or DIE($dbcon->ErrorMsg());
	if ($_FILES['file']['name']) {
		$image2 = upload_image('',$getimgset->Fields("optw"),$getimgset->Fields("optl"),$getimgset->Fields("thumb"));
	}