示例#1
1
function throwErrorPage($code)
{
    if ($code == "404") {
        $header = $_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found';
    } else {
        if ($code == "403") {
            $header = $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden';
        } else {
            $header = $_SERVER['SERVER_PROTOCOL'] . ' ' . $code;
        }
    }
    header($header);
    $errorPage = sConfig()->getVar('CONFIG/ERRORPAGES/ERROR_' . $code);
    if ($errorPage && $errorPage != '') {
        $request_path_string = getRequestPathString(explode('/', 'page' . $errorPage));
        $request_path = getRequestPathArray($request_path_string);
        $psite = $request_path[1];
        if ((int) $psite > 0) {
            $sinfo = sSites()->get($psite);
            $siteID = (int) $psite;
        } else {
            $sinfo = sSites()->getByPName($psite);
            $siteID = $sinfo['ID'];
        }
        $pageMgr = new PageMgr($siteID);
        $pageID = $pageMgr->getPageIdByPname($request_path[count($request_path) - 1]);
        $page = $pageMgr->getPage($pageID);
        $pageInfo = $page->get();
        $version = $page->getLatestVersion();
        renderPage($page, $version, $pageInfo, $pageMgr, $sinfo);
    } else {
        echo $header;
    }
    die;
}
示例#2
0
 function form()
 {
     $data = initializeData($this, "Form");
     $data['page_url'] = main_url() . 'leave_credits';
     $leave = '';
     $dp = '';
     $stat = '';
     $dept = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $leave = $data['data'][0]->leave_types_id;
             $dept = $this->mod->getEmpTypeOfLeaveCredit($data['data'][0]->id);
             $stat = $this->mod->getStatOfLeaveCredit($data['data'][0]->id);
             $dept = $dept[0]->id;
             $stat = $stat[0]->id;
         }
     }
     $sJs = 'class="form-control form-text"';
     $list1 = $this->emp_types_model->getObjectList('');
     $list2 = $this->status_model->getObjectList('');
     $data['emptypes_list'] = genEmpTypesListUI($this, $list1, $dept);
     $data['status_list'] = genStatusListUI($this, $list2, $stat);
     $this->load->model('leave_types_model');
     $list2 = $this->leave_types_model->getObjectList('');
     $data['leave'] = generateSelectUI($this, $list2, 'leave_types_id', 'id', 'title', $leave, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
示例#3
0
function render($storeName)
{
    $data = array();
    $index = select_to_array($storeName, 'SELECT DISTINCT ?o WHERE {?s a ?o}');
    $content = '';
    $content .= '<form method="post" action="find.php"';
    $content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/>&nbsp;';
    $content .= '<div align="center">';
    $content .= '<input type="text" name="resourceUri" size="80%" value=""/>&nbsp;';
    $content .= '<input type="submit" name="submit" value="Find"/>';
    $content .= '</div>';
    $content .= '</form>';
    if (count($index) > 0) {
        $content .= 'Found ' . count($index) . ' data types<p>';
        $content .= '<div class="findResults">';
        $content .= '<ul>';
        foreach ($index as $item) {
            $itemUri = $item['o']['value'];
            $label = $itemUri;
            $showUri = 'find.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
            $content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $label . '</a></span></li>';
        }
        $content .= '</ul>';
        $content .= '</div>';
    } else {
        $content .= 'No data types found<p>';
    }
    renderPage($storeName, null, 'Data types', $content);
}
示例#4
0
function render($storeName, $message = null, $error = null)
{
    $content = '';
    if (!empty($message)) {
        $content .= '<div align="center">';
        $content .= $message;
        $content .= '</div>';
    }
    if (!empty($error)) {
        $content .= '<pre>';
        $content .= $error;
        $content .= '</pre>';
        $content .= '<br/>';
    }
    $content .= '<form enctype="multipart/form-data" action="upload.php" method="post">';
    $content .= '<input type="hidden" name="storeName" value="' . $storeName . '" />';
    $content .= '<div align="center">';
    $content .= '<br/>';
    $content .= '<p><input type="file" name="uploadedfile" size="80" />';
    $content .= '<br/>';
    $content .= '<br/>';
    $content .= '<p><input type="submit" name="submit" value="Upload"/>';
    $content .= '</div>';
    $content .= '</form>';
    renderPage($storeName, null, 'Upload file', $content);
}
示例#5
0
function doPost()
{
    $storeName = $_POST['storeName'];
    if (!empty($_POST['btnOK'])) {
        $store = getStore($storeName);
        $job_queue = $store->get_job_queue();
        $response = $job_queue->schedule_reset_data();
        $content = '';
        if ($response->is_success()) {
            $jobUri = $response->headers['location'];
            $message = 'Scheduled reset job';
            $content .= 'Reset job details<p>';
            $content .= '<div class="findResults">';
            $content .= '<ul>';
            $content .= '<li><span class="lnkShowItem" ><a href="' . $jobUri . '">' . $jobUri . '</a></span></li>';
            $content .= '</ul>';
            $content .= '</div>';
        } else {
            $message = 'Failed to schedule reset job';
            $content .= 'Response details<p>';
            $content .= '<pre>';
            $content .= $response->to_string();
            $content .= '</pre>';
        }
        renderPage($storeName, null, $message, $content);
    } else {
        header('Location: find.php?storeName=' . $storeName . '&resourceUri=');
    }
}
示例#6
0
function render($storeName, $token, $from, $to, $type)
{
    $content = '';
    $content .= '<form method="get"';
    $content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/>&nbsp;';
    $content .= '<div align="center">';
    $content .= '<label>Start Date</label>';
    $content .= '<input id="from" name="from" type="text" value="' . $from . '" maxlength="30" size="30" />';
    //	$content .= '<img class="ui-datepicker-trigger" src="images/datepicker.gif" alt="Pick a start date" title="Pick a start date"/>';
    //	$content .= '<script type="text/javascript">';
    //	$content .= '$(document).ready(function(){$("#from").datepicker({showOn: "button", buttonImage: "images/datepicker.gif", buttonImageOnly: true,  dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true});});';
    //	$content .= '</script>';
    $content .= '<p>';
    $content .= '<label>End Date</label>';
    $content .= '<input id="to" name="to" type="text" value="' . $to . '" maxlength="30" size="30" />';
    //	$content .= '<img class="ui-datepicker-trigger" src="images/datepicker.gif" alt="Pick an end date" title="Pick an end date"/>';
    //	$content .= '<script type="text/javascript">';
    //	$content .= '$(document).ready(function(){$("#to").datepicker({showOn: "button", buttonImage: "images/datepicker.gif", buttonImageOnly: true,  dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true});});';
    //	$content .= '</script>';
    $content .= '<p>';
    $content .= '<input type="submit" name="submit" value="List"/>';
    $content .= '<input type="submit" name="submit" value="Graph"/>';
    $content .= '</div>';
    $content .= '</form>';
    if ($type == 'Graph') {
        $content .= renderGraph($storeName, $from, $to);
    } else {
        $content .= renderList($storeName, $token, $from, $to);
    }
    renderPage($storeName, null, null, $content);
}
示例#7
0
文件: Login.php 项目: taryono/trade
 public function index()
 {
     //get the posted values
     $username = $this->input->post("username");
     $password = $this->input->post("password");
     //set validations
     $this->form_validation->set_rules("username", "Username", "trim|required");
     $this->form_validation->set_rules("password", "Password", "trim|required");
     if ($this->form_validation->run() == FALSE) {
         $data = array('isLoggedIn' => FALSE);
         //validation fails
         renderPage('login_view', $data, '');
     } else {
         //validation succeeds
         if ($this->input->post('btn_login') == "Login") {
             //check if username and password is correct
             $usr_result = $this->login_model->get_user($username, $password);
             if ($usr_result > 0) {
                 //set the session variables
                 $sessiondata = array('username' => $username, 'loginuser' => TRUE);
                 $this->session->set_userdata($sessiondata);
                 $this->load->library('user_lib');
                 $this->user_lib->redirect();
             } else {
                 $this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">Invalid username and password!</div>');
                 redirect('login');
             }
         }
     }
 }
示例#8
0
function render($storeName, $resourceUri)
{
    $content = '';
    $content .= '<form method="get" action="find.php"';
    $content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/>&nbsp;';
    $content .= '<div align="center">';
    $content .= '<input type="text" name="resourceUri" size="80%" value="' . $resourceUri . '"/>&nbsp;';
    $content .= '<input type="submit" name="submit" value="Find"/>';
    $content .= '</div>';
    $content .= '</form>';
    if (!empty($resourceUri)) {
        if (substr($resourceUri, 0, 5) == 'http:') {
            $index = describe_to_simple_index($storeName, $resourceUri);
            if (isset($index[$resourceUri])) {
                $content .= 'Found as subject<p>';
                $content .= '<div class="findResults">';
                $content .= '<ul>';
                $itemUri = $resourceUri;
                $showUri = 'show.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
                $content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $itemUri . '</a></span></li>';
                $content .= '</ul>';
                $content .= '</div>';
            } else {
                $content .= 'Not found as subject<p>';
            }
            $select = 'SELECT ?s where {?s ?p <' . $resourceUri . '>}';
            $selectResults = select_to_array($storeName, $select);
            if (!empty($selectResults)) {
                $content .= 'Found as object<p>';
                $content .= '<div class="findResults">';
                $content .= '<ul>';
                foreach ($selectResults as $selectResult) {
                    $itemUri = $selectResult['s']['value'];
                    $showUri = 'show.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
                    $content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $itemUri . '</a></span></li>';
                }
                $content .= '</ul>';
                $content .= '</div>';
            } else {
                $content .= 'Not found as object<p>';
            }
        } else {
            $results = search_to_resource_list($storeName, $resourceUri);
            $content .= 'Found ' . $results->total_results . ' items in indexes<p>';
            $content .= '<div class="findResults">';
            $content .= '<ul>';
            foreach ($results->items as $item) {
                $itemUri = $item['http://purl.org/rss/1.0/link'][0];
                $showUri = 'show.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
                $content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $itemUri . '</a></span></li>';
            }
            $content .= '</ul>';
            $content .= '</div>';
        }
    }
    renderPage($storeName, null, null, $content);
}
示例#9
0
function render($storeName, $resourceUri)
{
    $data = array();
    $index = describe_to_simple_index($storeName, $resourceUri);
    if (isset($index[$resourceUri])) {
        $data = $index[$resourceUri];
        ksort($data);
    }
    $content = '';
    $content .= '<form method="post"';
    $content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/>&nbsp;';
    $content .= '<div align="center">';
    $content .= '<input type="text" name="resourceUri" size="80%" value="' . $resourceUri . '"/>&nbsp;';
    $content .= '<input type="submit" name="submit" value="Find"/>';
    $content .= '</div>';
    $content .= '</form>';
    if (count($data) > 0) {
        $content .= '<table>';
        $content .= '<thead>';
        $content .= '<tr><th>actions</th><th>predicate</th><th>object</th></tr>';
        $content .= '</thead>';
        $content .= '<tbody>';
        $content .= '<tr>';
        $content .= '<td>';
        $content .= '<span class="lnkDeleteTriple"><a title="delete all triples for resource" href="delete.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '">&nbsp;</a></span>';
        $content .= '<span class="lnkDeleteTriple"><a title="delete all triples for resource" href="delete.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '">&nbsp;</a></span>';
        $content .= '</td>';
        $content .= '<td></td>';
        $content .= '<td></td>';
        $content .= '</tr>';
        foreach ($data as $predicate => $objects) {
            $index = 0;
            foreach ($objects as $object) {
                $value = $object['value'];
                $type = $object['type'];
                $content .= '<tr>';
                $content .= '<td>';
                $content .= '<span class="lnkDeleteTriple"><a title="delete triple" href="delete.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '&predicate=' . urlencode($predicate) . '&type=' . urlencode($type) . '&value=' . urlencode($value) . '">&nbsp;</a></span>';
                $content .= '<span class="lnkEditTriple"><a title="edit triple" href="edit.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '&predicate=' . urlencode($predicate) . '&type=' . urlencode($type) . '&value=' . urlencode($value) . '">&nbsp;</a></span>';
                $content .= '</td>';
                $content .= '<td>' . $predicate . '</td>';
                $content .= '<td>';
                if ($type == 'uri') {
                    $content .= '<a href="?storeName=' . $storeName . '&resourceUri=' . urlencode($value) . '">' . $value . '</a>';
                } else {
                    $content .= $value;
                }
                $content .= '</td>';
                $content .= '</tr>' . "\n";
                $index++;
            }
        }
        $content .= '</tbody>';
        $content .= '</table>';
    }
    renderPage($storeName, $resourceUri, null, $content);
}
示例#10
0
function render($storeName)
{
    $content = '';
    $status = get_store_status($storeName);
    $content .= '<div style="text-align: center;"><br/>';
    $content .= $status;
    $content .= '</div>';
    renderPage($storeName, null, 'Store status', $content);
}
示例#11
0
 function form()
 {
     $data = initializeData($this, "Department Form");
     $data['page_url'] = main_url() . 'departments';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
         }
     }
     renderPage($this, $this->table . '/form', $data);
 }
示例#12
0
 function form()
 {
     $data = initializeData($this, "Rank Form");
     $data['page_url'] = main_url() . 'ranks';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
         }
     }
     $sJs = 'class="form-control form-text"';
     renderPage($this, $this->table . '/form', $data);
 }
示例#13
0
 function reports2()
 {
     $data = initializeData($this, "Statistics and Reports");
     $data['page_url'] = main_url() . 'employment';
     $sJs = 'class="form-control form-text"';
     $list1 = $this->emp_types_model->getObjectList('');
     $list2 = $this->status_model->getObjectList('');
     $list3 = $this->departments_model->getObjectList('');
     $data['dept_list'] = genDepartmentListUI($this, $list3, '');
     $data['emptypes_list'] = genEmpTypesListUI($this, $list1, '');
     $data['status_list'] = genStatusListUI($this, $list2, '');
     renderPage($this, $this->table . '/reports2', $data);
 }
示例#14
0
 public function index()
 {
     // get the posted values
     $name = $this->input->post("name");
     $username = $this->input->post("username");
     $password = $this->input->post("password");
     // set validations
     $this->form_validation->set_rules("username", "Username", "trim|required|is_unique[users.username]", array('is_unique' => 'This %s already exists.'));
     $this->form_validation->set_rules("password", "Password", "trim|required");
     $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required|matches[password]');
     $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
     if ($this->form_validation->run() == FALSE) {
         $data = array('isLoggedIn' => FALSE);
         // validation fails
         renderPage('register_view', $data, '');
     } else {
         // validation succeeds
         if ($this->input->post('btn_login') == "Register") {
             $this->db->trans_begin();
             try {
                 $this->user->name = $this->input->post('name');
                 $this->user->username = $this->input->post('username');
                 $this->user->email = $this->input->post('email');
                 $this->user->password = md5($this->input->post('password'));
                 $token = md5($this->input->post('username') . random_string('alnum', 10) . time());
                 $this->user->emailToken = $token;
                 if (!$this->send_verified_email($this->input->post('email'), $token)) {
                     throw new ErrorException('Send email failed.');
                 }
                 //$register = $this->user->insert ( $this->user );
                 $register = false;
                 if (!$register) {
                     throw new ErrorException('Register failed.');
                 } else {
                     $this->user->assignRole('user', $register);
                     $this->user_id = $register;
                     //$this->insert_related_table ();
                     //$this->db->trans_commit ();
                     $this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">Register success Bro, silahkan cek email untuk melakukan verifikasi!</div>');
                     $data = array('isLoggedIn' => false);
                     renderPage('register_success', $data, '');
                 }
             } catch (ErrorException $e) {
                 $this->db->trans_rollback();
                 $this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">' . $e->getMessage() . '</div>');
                 redirect('register/');
             }
         }
     }
 }
示例#15
0
 function form()
 {
     $data = initializeData($this, "Employee Types Form");
     $data['page_url'] = main_url() . 'emp_types';
     $da = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $da = $data['data'][0]->time_unit;
         }
     }
     $sJs = 'class="form-control form-text"';
     $data['time_unit_list'] = form_dropdown('time_unit', array('h' => 'Hours', 'd' => 'Days'), $da, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
示例#16
0
 function form()
 {
     $data = initializeData($this, "Role Form");
     $data['page_url'] = main_url() . 'roles';
     $r = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $r = $data['data'][0]->role_code;
         }
     }
     $sJs = 'class="form-control form-text"';
     $rolecodelist = $this->mod->getEnumValues('roles', 'roles', 'role_code');
     $data['rolecode_list'] = form_dropdown('role_code', $rolecodelist, $r, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
示例#17
0
 function form()
 {
     $data = initializeData($this, "Form");
     $data['page_url'] = main_url() . 'emp_types_stat';
     $empt = '';
     $stat = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $empt = $data['data'][0]->emp_types_id;
             $stat = $data['data'][0]->status_id;
         }
     }
     $emptlist = $this->emp_types_model->getObjectList('');
     $statuslist = $this->status_model->getObjectList('');
     $data['emptypes_list'] = genEmpTypesListUI($this, $emptlist, $empt);
     $data['status_list'] = genStatusListUI($this, $statuslist, $stat);
     renderPage($this, $this->table . '/form', $data);
 }
示例#18
0
function render($storeName, $resourceUri)
{
    $content = '';
    $content .= '<form method="post">';
    $content .= '<p><label>subject</label><input type="text" id="newSubject" name="newSubject" value="' . $resourceUri . '" size="70%" maxlength="500"/>';
    $content .= '<p><label>predicate</label><input type="text" id="newPredicate" name="newPredicate" value="" size="70%" maxlength="500"/>';
    $content .= '<p><label>value</label><input type="text" id="newObject" name="newObject" value="" size="70%" maxlength="500"/>';
    $content .= '<p><label>type</label><select name="newType">';
    $content .= '<option value="literal">literal</option>';
    $content .= '<option value="uri">uri</option>';
    $content .= '</select>';
    $content .= '<input type="hidden" name="storeName" value="' . $storeName . '"/>';
    $content .= '<div style="text-align: center;"><br/>';
    $content .= '<input type="submit" name="btnCancel" value="Cancel"/>';
    $content .= '<input type="submit" name="btnOK" value="OK"/>';
    $content .= '</div>';
    $content .= '</form>';
    renderPage($storeName, $resourceUri, 'Add triple', $content);
}
示例#19
0
文件: live.php 项目: r043v/fastIce
	function live($url='fr/index')
	{	
		$path = explode('/',$url);
		if(strlen($path[0]) == 2) // check for lang
			$lang = array_shift($path);
		else	$lang = defaultLangage;

		if(isset($path[1])) // there is a path ?
		{	$pageToShow = array_pop($path);
			$urlPath = array_shift($path); foreach($path as $word) $urlPath .= '/'.$word;
		} else
		{	$urlPath = '';
			if(isset($path[0]))
				$pageToShow = $path[0];
			else	$pageToShow = 'index';
		}

		$page = renderPage($pageToShow,$lang,$urlPath,function($page)
		{	callPlugin('page',array('info'));
		},'live',true);

		return $page;
	}
示例#20
0
function render($storeName, $resourceUri, $predicate, $type, $value, $message)
{
    $content = '';
    $content .= '<form method="post">';
    $content .= '<p><label>subject</label><input readonly="readonly" type="text" id="subject" name="subject" value="' . $resourceUri . '" size="70%" maxlength="500"/>';
    if (!empty($predicate)) {
        $content .= '<p><label>predicate</label><input readonly="readonly" type="text" id="predicate" name="predicate" value="' . $predicate . '" size="70%" maxlength="500"/>';
    }
    if (!empty($value)) {
        $content .= '<p><label>value</label><input readonly="readonly" type="text" id="value" name="value" value="' . $value . '" size="70%" maxlength="500"/>';
    }
    if (!empty($type)) {
        $content .= '<p><label>type</label><input readonly="readonly" type="text" id="type" name="type" value="' . $type . '" size="70%" maxlength="500"/>';
    }
    $content .= '<input type="hidden" name="storeName" value="' . $storeName . '"/>';
    $content .= '<input type="hidden" name="resourceUri" value="' . $resourceUri . '"/>';
    $content .= '<div style="text-align: center;"><br/>';
    $content .= '<input type="submit" name="btnCancel" value="Cancel"/>';
    $content .= '<input type="submit" name="btnOK" value="OK"/>';
    $content .= '</div>';
    $content .= '</form>';
    renderPage($storeName, $resourceUri, $message, $content);
}
示例#21
0
function render()
{
    $loginDetails = getLastLogin();
    $lastStoreName = $loginDetails['storeName'];
    $lastUsername = $loginDetails['username'];
    $lastPassword = $loginDetails['password'];
    $storeCollection = new StoreCollection('http://api.talis.com/stores');
    $storeCollection->retrieve();
    $storeUris = $storeCollection->get_store_uris();
    asort($storeUris);
    $content = '';
    $content .= '<form method="post"';
    $content .= '<div align="center">';
    $content .= '<select name="storeName">';
    foreach ($storeUris as $storeUri) {
        $storeName = str_replace('http://api.talis.com/stores/', '', $storeUri);
        $content .= '<option ';
        if ($storeName == $lastStoreName) {
            $content .= ' selected="selected" ';
        }
        $content .= ' value="' . $storeName . '">' . $storeName . '</option>';
    }
    $content .= '</select>';
    $content .= '</div>';
    $content .= '<br/><br/><br/>';
    $content .= '<div align="center">';
    $content .= '<label>Username</label><input type="text" name="username" value="' . $lastUsername . '"/>';
    $content .= '<p>';
    $content .= '<label>Password</label><input type="password" name="password" value="' . $lastPassword . '"/>';
    $content .= '</div>';
    $content .= '<br/><br/><br/>';
    $content .= '<div align="center">';
    $content .= '<input type="submit" name="submit" value="Select"/>';
    $content .= '</div>';
    $content .= '</form>';
    renderPage(null, null, 'Choose a store', $content);
}
示例#22
0
function render($storeName, $resourceUri, $predicate, $value, $type)
{
    $uriSelected = $type == 'uri' ? 'selected="selected"' : '';
    $literalSelected = $type == 'literal' ? 'selected="selected"' : '';
    $content = '';
    $content .= '<form method="post">';
    $content .= '<p><label>subject</label><input type="text" id="subject" name="subject" value="' . $resourceUri . '" size="70%" maxlength="500"/>';
    $content .= '<p><label>predicate</label><input type="text" id="newPredicate" name="newPredicate" value="' . $predicate . '" size="70%" maxlength="500"/>';
    $content .= '<p><label>value</label><input type="text" id="newObject" name="newObject" value="' . $value . '" size="70%" maxlength="500"/>';
    $content .= '<p><label>type</label><select name="newType">';
    $content .= '<option value="literal" ' . $literalSelected . ' >literal</option>';
    $content .= '<option value="uri" ' . $uriSelected . ' >uri</option>';
    $content .= '</select>';
    $content .= '<input type="hidden" name="storeName" value="' . $storeName . '"/>';
    $content .= '<input type="hidden" name="oldPredicate" value="' . $predicate . '"/>';
    $content .= '<input type="hidden" name="oldObject" value="' . $value . '"/>';
    $content .= '<input type="hidden" name="oldType" value="' . $type . '"/>';
    $content .= '<div style="text-align: center;"><br/>';
    $content .= '<input type="submit" name="btnCancel" value="Cancel"/>';
    $content .= '<input type="submit" name="btnOK" value="OK"/>';
    $content .= '</div>';
    $content .= '</form>';
    renderPage($storeName, $resourceUri, 'Edit triple', $content);
}
示例#23
0
    $fileFilterA->setExcludeFilePattern($config['filesystem.exclude_file_pattern']);
    if (!$fileFilterA->accept($targetFile)) {
        $data['errorMsg'] = $config['filesystem.invalid_file_name_msg'];
        renderPage("zip.tpl.php", $data);
    }
    /*
    // Setup second filter
    $fileFilterB =& new BasicFileFilter();
    $fileFilterB->setIncludeFilePattern($config['zip.include_file_pattern']);
    $fileFilterB->setExcludeFilePattern($config['zip.exclude_file_pattern']);
    if (!$fileFilterB->accept($targetFile)) {
    	$data['errorMsg'] = $config['zip.invalid_file_name_msg'];
    	renderPage("zip.tpl.php", $data);
    }
    */
    $archive = new PclZip($targetFile->getAbsolutePath());
    $files = array();
    for ($i = 0; $absPath = getRequestParam("file" . $i, false); $i++) {
        $file =& $fileFactory->getFile($absPath);
        $files[] = $file->getAbsolutePath();
    }
    $list = $archive->create(implode(',', $files), PCLZIP_OPT_REMOVE_PATH, $targetFile->getParent());
    if ($list == 0) {
        $data['errorMsg'] = $archive->errorInfo(true);
    } else {
        $targetFile->importFile();
    }
}
// Render output
renderPage("zip.tpl.php", $data);
示例#24
0
$imageTools = explode(',', $config['thumbnail.image_tools']);
$information = array();
$information = explode(',', $config['thumbnail.information']);
$data['js'] = getRequestParam("js", "");
$data['formname'] = getRequestParam("formname", "");
$data['elementnames'] = getRequestParam("elementnames", "");
$data['disabled_tools'] = $config['general.disabled_tools'];
$data['image_tools'] = $imageTools;
$data['toolbar'] = $tools;
$data['full_path'] = $path;
$data['root_path'] = $rootpath;
$data['errorMsg'] = "dfdf";
//addslashes($errorMsg);
$data['selectedPath'] = $selectedPath;
$data['dirlist'] = $dirList;
$data['anchor'] = $anchor;
$data['exif_support'] = exifExists();
$data['gd_support'] = $isGD;
$data['edit_enabled'] = checkBool($config["thumbnail.gd.enabled"]);
$data['demo'] = checkBool($config["general.demo"]);
$data['demo_msg'] = $config["general.demo_msg"];
$data['information'] = $information;
$data['extension_image'] = checkBool($config["thumbnail.extension_image"]);
$data['insert'] = checkBool($config["thumbnail.insert"]);
$data['filemanager_urlprefix'] = removeTrailingSlash($config["filemanager.urlprefix"]);
$data['thumbnail_width'] = $config['thumbnail.width'];
$data['thumbnail_height'] = $config['thumbnail.height'];
$data['thumbnail_border_style'] = $config['thumbnail.border_style'];
$data['thumbnail_margin_around'] = $config['thumbnail.margin_around'];
renderPage("images.tpl.php", $data);
示例#25
0
 function form()
 {
     $data = initializeData($this, "Form");
     $data['page_url'] = main_url() . 'employment';
     $leave = '';
     $dp = '';
     if (isset($_GET['id'])) {
         if (!empty($_GET['id'])) {
             $data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
             $leave = $data['data'][0]->dept_stat_id;
             $dp = $data['data'][0]->employee_id;
         }
     }
     $sJs = 'class="form-control form-text"';
     $this->load->model('dept_stat_model');
     $emptstat = $this->emp_types_stat_model->getListByQuery('');
     $this->load->model('employees_model');
     $emp = $this->employees_model->getEmployeeList('');
     $data['emptypesstat_list'] = generateSelectUI($this, $list1, 'emp_types_stat_id', 'id', 'emp_types_name', $emptstat, $sJs);
     $data['employees_list'] = generateSelectUI($this, $list2, 'employee_id', 'id', 'fullname', $emp, $sJs);
     renderPage($this, $this->table . '/form', $data);
 }
示例#26
0
    $template->set('release', $firmware->release);
    $template->set('hash', $firmware->hash ? $firmware->hash->md5 : "");
    $template->set('filename', $firmware->filename);
    $template->set('url', "http://firmware.freifunk-myk.de" . $key);
    if ($firmware->sysupgrade) {
        if ($firmware->branch == "stable") {
            $stableSysupgrade .= $template->render();
        } else {
            if ($firmware->branch == "beta") {
                $betaSysupgrade .= $template->render();
            }
        }
    } else {
        if ($firmware->branch == "stable") {
            $stableFactory .= $template->render();
        } else {
            if ($firmware->branch == "beta") {
                $betaFactory .= $template->render();
            }
        }
    }
}
$table = new TemplateFile($config->paths->templates . "markup/router_firmware_accordion.inc");
$table->set('stableSysupgrade', $stableSysupgrade);
$table->set('stableFactory', $stableFactory);
$table->set('betaSysupgrade', $betaSysupgrade);
$table->set('betaFactory', $betaSysupgrade);
$page->set('firmwareTable', $table->render());
$page->set('headline', $page->parent->title . " " . $page->title);
$content = renderPage();
示例#27
0
 *      
 *      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *      
 *      
 */
if (!defined('IN_RECOVERY')) {
    die;
}
// the software is already installed
if (defined('INSTALLED')) {
    $action = "installed";
}
// during installation we want to show errors
ini_set('display_errors', TRUE);
error_reporting(E_ALL);
if ("GET" == $_SERVER['REQUEST_METHOD']) {
    $error = '';
    $status = '';
    $templates[] = array('name' => 'setup', 'vars' => array('timezones' => timezone_identifiers_list(), 'error' => $error, 'status' => $status));
    renderPage($templates);
}
示例#28
0
    rename($tempname, $filepath);
    // Overwrite original picture with thumbnail.
    return true;
}
try {
    mergeDeprecatedConfig($GLOBALS, isLoggedIn());
} catch (Exception $e) {
    error_log('ERROR while merging deprecated options.php file.' . PHP_EOL . $e->getMessage());
}
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=genthumbnail')) {
    genThumbnail();
    exit;
}
// Thumbnail generation/cache does not need the link database.
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=rss')) {
    showRSS();
    exit;
}
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=atom')) {
    showATOM();
    exit;
}
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=dailyrss')) {
    showDailyRSS();
    exit;
}
if (!isset($_SESSION['LINKS_PER_PAGE'])) {
    $_SESSION['LINKS_PER_PAGE'] = $GLOBALS['config']['LINKS_PER_PAGE'];
}
renderPage();
示例#29
0
    }
    // Structur
    $table = "<table>\n              <thead>\n                <tr>\n                {$tableHead}\n                </tr>\n              </thead>\n                <tbody>\n                {$tableBody}\n                </tbody>\n              </table>";
    return $table;
}
// Wenn inputsegment 1 nicht gesetzt ist dann leite auf den aktuellen Benutzer weiter.
if (!wire('user')->isLoggedin()) {
    throw new Wire404Exception();
}
if (!$input->urlSegment1) {
    $session->redirect("{$pages->get('/profile/')->url}{$user->name}");
}
#if($input->urlSegment3) throw new Wire404Exception();
$u = $users->get("name={$sanitizer->name($input->urlSegment1)}");
$page->title = "{$page->title} {$u->name}";
$page->userID = $u->id;
if ($user instanceof NullPage) {
    throw new Wire404Exception();
}
// Nodes
$page->nodes = $pages->find("template=node, operator={$u->id}");
// IPs
$page->ips = $pages->find("template=staticip, operator={$u->id}");
$liste = "";
$userlist = $users->find("start=0, name!='guest'");
foreach ($userlist as $uli) {
    $liste .= "<li><a href='{$pages->get('/profile/')->httpUrl}{$uli->name}'>{$uli->name}</a></li>";
}
$page->userlist = "<ul>{$liste}</ul>";
$content = $user->id === $u->id ? renderPage('profile_private') : renderPage();
示例#30
0
文件: library.php 项目: newhouseb/SWS
function compilePages($template, $filepath, $urlpath = "/")
{
    // Get Simple Website Schema
    $xml = new DOMDocument();
    $xml->load($template);
    $xml_xpath = new DOMXPath($xml);
    $query = $xml_xpath->query("//page");
    $home = TRUE;
    foreach ($query as $page) {
        //We don't need to generate links to external sources
        if ($page->getAttribute("ref")) {
            continue;
        }
        //Get the full path
        $path = "";
        $ptr = $page;
        while ($ptr->nodeName != "site") {
            if ($ptr->getAttribute("link")) {
                $path = (string) $ptr->getAttribute("link") . "/" . $path;
            }
            $ptr = $ptr->parentNode;
        }
        // TODO: Sanitize these
        //echo $path."...";
        @mkdir(rtrim($filepath, "/") . "/" . trim($path, "/"), 0777, TRUE);
        $fh = fopen(rtrim($filepath, "/") . "/" . trim($path, "/") . "/index.html", "w");
        fwrite($fh, renderPage($template, $path, TRUE, rtrim($urlpath, "/") . "/"));
        fclose($fh);
        //We need to generate the default index under to title too
        if ($home === TRUE) {
            $fh = fopen(rtrim($filepath, "/") . "/index.html", "w");
            fwrite($fh, renderPage($template, $path, TRUE, rtrim($urlpath, "/") . "/"));
            fclose($fh);
            $home = FALSE;
        }
        //echo " done<br />";
    }
}