示例#1
0
 public function Page($template, $variables, $title, $languageFiles, $extraScripts = '', $showTopNavigation = true, $isInGame = false, $extraMetaTags = '')
 {
     global $NN_config;
     $this->_languageFiles = $languageFiles;
     $currentUser = User::GetCurrentUser();
     $userLevelName = $currentUser->AuthorisationLevelName();
     // Get name of userlevel
     // TODO: have this use $currentUser
     //$userLevelName = Database::Instance()->ExecuteQuery("SELECT name FROM authorisation WHERE level = ".$currentUser->AuthorisationLevel().";","SELECT");
     $resultSet = Database::Instance()->ExecuteQuery("SELECT name FROM authorisation WHERE level = 0;", "SELECT");
     $userLevelName = $resultSet['name'];
     if ($userLevelName == NULL) {
         return null;
     }
     // Load common variables
     $CommonVariables = self::CommonFiles();
     // Render the header, add it to the content
     $this->_content = $this->RenderHeader($CommonVariables, $title, $userLevelName, $extraMetaTags, $extraScripts);
     // If we are in the game, render the side bar
     if ($isInGame) {
         $this->_content .= $this->RenderSidebar($CommonVariables, $userLevelName);
     }
     // If required, render the top navigation bar
     if ($showTopNavigation) {
         // Load navigation variables
         $variables['TODO'] = "add some variables";
     }
     // Render the actual content
     $this->_content .= $this->RenderContent($CommonVariables, $template, $variables, $userLevelName);
     // Render the footer
     $this->_content .= $this->RenderFooter($CommonVariables, $userLevelName);
 }
示例#2
0
 function Show($mainPlaceHolder, $headerPlaceHolder, $pageTitle, $data)
 {
     $user = User::GetCurrentUser();
     $data['site_name'] = $this->config->item('site_name');
     $data['headerPlaceHolder'] = $headerPlaceHolder;
     $data['pageTitle'] = $pageTitle;
     $data['mainPlaceHolder'] = $mainPlaceHolder;
     $this->load->view('account/master', $data);
 }
示例#3
0
 public static function FromDatabase(array $row, Colony $colony = NULL)
 {
     // Slice off fleetID, colonyID, mission type and cargo data
     $shipList = array_slice($row, 6);
     if ($colony === NULL) {
         $colony = Colony::FromDatabaseByID($row['colonyID'], User::GetCurrentUser());
     }
     $members = CombatUnit::MakeListFrom($shipList);
     $missiontype = $row['mission_type'];
     $id = $row['fleetID'];
     $cargo = new Cost($row['metal_in_cargo'], $row['crystal_in_cargo'], $row['deuterium_in_cargo'], 0);
     return new ShipFleet($members, $colony, $missiontype, $cargo, $id);
 }
 public static function FromDatabase(array $row, Colony $colony = NULL)
 {
     $transport = new Transportation();
     $fleet = ShipFleet::FromDatabaseByID($row['fleetID']);
     $transport->Fleet($fleet);
     $transport->ID($row['transportID']);
     if ($colony === NULL) {
         $colony = Colony::FromDatabaseByID($row['colonyID'], User::GetCurrentUser());
     }
     $transport->ReceivingColony($colony);
     $transport->ScheduledTime($row['scheduled_time']);
     $transport->IsValid(true);
     // Anything that gets into the database is valid.
     return $transport;
 }
示例#5
0
 public function addarticle()
 {
     $data = array();
     // 		$course_id = 0;
     $img_name = '';
     $data['actLi'] = "article";
     $data['typeList'] = $this->article_type;
     //		$data['courseTypeList'] = $this->mp_pandora->Get_CourseTypeList();
     $id = $this->input->get('article_id');
     if ($id) {
         $data['articleObj'] = $this->mp_pandora->Get_ArticleById($id);
     }
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->load->library('form_validation');
         $id = $this->input->post('txtId');
         $this->form_validation->set_rules('selArticleType', "文章类型", 'trim|required');
         $this->form_validation->set_rules('txtTitle', "标题", 'trim|required');
         $this->form_validation->set_rules('txtContent', "内容", 'trim|required');
         if ($this->form_validation->run() == TRUE) {
             $type_id = trim($this->input->post("selArticleType"));
             $title = trim($this->input->post("txtTitle"));
             $content = trim($this->input->post("txtContent"));
             $img_name = trim($this->input->post("txtImgLink"));
             $author = trim($this->input->post("txtAuthor"));
             // 				if($type_id == 2)
             // 					$course_id = $this->input->post("selCourseType");
         }
         $currentUser = User::GetCurrentUser();
         $manager = $currentUser->full_name;
         if ($id) {
             if ($this->mp_pandora->Update_ArticleInfo($id, $type_id, $title, $content, $manager, $img_name, $author)) {
                 redirect("/account/articlemanage");
             } else {
                 $data['error_msg'] = "更新文章信息失败,请重试!";
             }
         } else {
             if ($this->mp_pandora->Creat_Article($type_id, $title, $content, $manager, $img_name, $author)) {
                 redirect("/account/articlemanage");
             } else {
                 $data['error_msg'] = "新建文章失败,请重试!";
             }
         }
     }
     $scriptExtra = '<script type="text/javascript" src="/public/js/jquery.validate.min.js"></script>';
     $scriptExtra .= '<script type="text/javascript" src="/public/js/add_article.js"></script>';
     $content = $this->load->view('account/add_article', $data, TRUE);
     $this->mp_master->Show($content, $scriptExtra, "主页", $data);
 }
示例#6
0
<?php

include "root.inc";
require_once "{$ROOT}/common.php";
$_SESSION['NewNovaID'] = 1;
$user = User::GetCurrentUser();
if ($user == NULL) {
    return;
}
// Fill galaxy and system selection menu
if ($_GET) {
    $system = $_GET['system'];
    if (isset($_GET['systemRight'])) {
        $system++;
    } elseif (isset($_GET['systemLeft'])) {
        $system--;
    }
    $galaxy = $_GET['galaxy'];
    if (isset($_GET['galaxyRight'])) {
        $galaxy++;
    } elseif (isset($_GET['galaxyLeft'])) {
        $galaxy--;
    }
} else {
    $galaxy = $user->CurrentColony()->Coordinates()->Galaxy();
    $system = $user->CurrentColony()->Coordinates()->System();
}
$coordinates = new Coordinates($galaxy, $system, 1);
// The Coordinates class automatically clamps values, so they're always within range
$vars['current_galaxy'] = $coordinates->Galaxy();
$vars['current_system'] = $coordinates->System();
示例#7
0
        <!-- Daterange picker -->
        <link href="/public/css/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
        <!-- bootstrap wysihtml5 - text editor -->
        <link href="/public/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />
        <!-- Theme style -->
        <link href="/public/css/AdminLTE.css" rel="stylesheet" type="text/css" />

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
    </head>
    <?php 
$userObj = User::GetCurrentUser();
?>
    <body class="skin-blue">
        <!-- header logo: style can be found in header.less -->
        <header class="header">
            <a href="/" class="logo">
                <!-- Add the class icon to your logo image or logo icon to add the margining -->
                <?php 
echo $site_name;
?>
            </a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>