implemented list api, not working though. sql is sqishy
This commit is contained in:
parent
d78842a1ad
commit
c1ea77e598
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_list','');
|
||||
|
||||
|
||||
44
neopolimatrix/page/default_list/default_list.php
Normal file
44
neopolimatrix/page/default_list/default_list.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
class default_list extends \SYSTEM\PAGE\Page {
|
||||
|
||||
var $filter = null;
|
||||
public function __construct($filter) {
|
||||
new \SYSTEM\LOG\INFO($filter);
|
||||
$this->filter = $filter;
|
||||
}
|
||||
|
||||
private function switch_filter($filter){
|
||||
switch($filter){
|
||||
case 1:
|
||||
return '%';
|
||||
case 2:
|
||||
return '"%Überwachung%"';
|
||||
default:
|
||||
return 'filter fail';}
|
||||
|
||||
}
|
||||
|
||||
public function generate_list(){
|
||||
$result = '';
|
||||
$tag = $this->filter;
|
||||
$elements = elements::getAllElementsOfTag($this->switch_filter($tag));
|
||||
foreach($elements as $element){
|
||||
$element['title'] = $element['id'];
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_list/element.tpl'), $element);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['content'] = $this->generate_list();
|
||||
new SYSTEM\LOG\INFO(print_r($vars['content']), TRUE);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_list/default_list.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
2
neopolimatrix/page/default_list/default_list.tpl
Normal file
2
neopolimatrix/page/default_list/default_list.tpl
Normal file
@ -0,0 +1,2 @@
|
||||
${content}
|
||||
test
|
||||
10
neopolimatrix/page/default_list/element.tpl
Normal file
10
neopolimatrix/page/default_list/element.tpl
Normal file
@ -0,0 +1,10 @@
|
||||
<div style="width: 750px; margin: auto; margin-bottom: 50px;">
|
||||
<p style="float: left; font-size: 10pt; margin-top: 7px;">Author: <i>${author}</i></p>
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">Veröffentlicht: ${timestamp}</p>
|
||||
<div style="clear: both;"></div>
|
||||
<div style="border-top: solid 1px black; width: 100%;"></div>
|
||||
<h2>${title}</h2>
|
||||
<br>
|
||||
${deDE}
|
||||
<br>
|
||||
</div>
|
||||
@ -6,8 +6,9 @@ class default_page extends \SYSTEM\PAGE\Page {
|
||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'jqbootstrapvalidation/jqBootstrapValidation.js').'"></script>'.
|
||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'hashmask/jquery.md5.js').'"></script>'.
|
||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'hashmask/jquery.sha1.js').'"></script>'.
|
||||
'<script src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/content.js').'"></script>'.
|
||||
'<script src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/account_create.js').'"></script>';
|
||||
'<script src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/state_init.js').'"></script>'.
|
||||
'<script src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/content.js').'"></script>';
|
||||
|
||||
}
|
||||
|
||||
private function css(){
|
||||
|
||||
@ -9,15 +9,15 @@
|
||||
</head>
|
||||
<body>
|
||||
<h2>Neo-PoliMatrix</h2>
|
||||
<div id="user_list" style=" float: right; text-align: left;">
|
||||
<div style="float: right; text-align: left;">
|
||||
<a href="http://www.mojotrollz.eu/web/Neopolimatrix">Blog</a>
|
||||
<a href="#tab_default" action="user_list_active">Impressum</a>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div class="tabbable" id="">
|
||||
<ul class="nav nav-tabs" id="">
|
||||
<li class="active"><a href="http://www.mojotrollz.eu/web/Neopolimatrix">Neu</a></li>
|
||||
<li class="li_cat"><a href="#">Überwachung</a></li>
|
||||
<ul class="nav nav-tabs" id="tabs_user_list">
|
||||
<li class="active"><a href="#contentframe" filter="1">Neu</a></li>
|
||||
<li class="li_cat"><a href="#contentframe" filter="2">Überwachung</a></li>
|
||||
<button style="float: right; margin-top: 7px; margin-right: 7px; padding: 2px;"class="btn btn-info" id="nav_search_btn">los geht's!</button>
|
||||
<input style="float: right; margin-top: 7px; margin-right: 7px;" type="text" id="nav_search" placeholder="Suchbegriff eingeben">
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<div style="width: 750px; margin: auto; margin-bottom: 50px;">
|
||||
<p style="float: left; font-size: 10pt; margin-top: 7px;">Author: <i>${author}</i></p>
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">Veröffentlicht: ${timestamp}</p>
|
||||
<div style="clear: both;"></div>
|
||||
<div style="border-top: solid 1px black; width: 100%;"></div>
|
||||
|
||||
@ -1,68 +1,14 @@
|
||||
$(document).ready(function() {
|
||||
register_user_list();
|
||||
load_user_list_tab('user_list_default');
|
||||
});
|
||||
|
||||
function register_user_list(){
|
||||
assign_signbox();
|
||||
assign_createbox();
|
||||
assign_deletebox();
|
||||
assign_filter();
|
||||
assign_delete_sign();
|
||||
assign_insert_shout()
|
||||
|
||||
$('#tabs_user_list a').click(function (e) {
|
||||
e.preventDefault();
|
||||
load_user_list_tab($(this).attr('action'));
|
||||
$(this).tab('show');
|
||||
});
|
||||
}
|
||||
|
||||
function load_user_list_tab(action){
|
||||
$('#tab_default').load('./?page='+ action, function(){
|
||||
switch(action){
|
||||
case 'user_list_default':
|
||||
assign_signbox();
|
||||
assign_insert_shout();
|
||||
|
||||
return;
|
||||
case 'user_list_active':
|
||||
assign_signbox();
|
||||
assign_deletebox();
|
||||
assign_delete_sign();
|
||||
assign_editbox();
|
||||
assign_filter();
|
||||
return;
|
||||
case 'user_list_ended':
|
||||
assign_deletebox();
|
||||
assign_editbox();
|
||||
return;
|
||||
case 'user_list_users':
|
||||
assign_tel_insertbox();
|
||||
return;
|
||||
case 'user_list_new':
|
||||
assign_createbox();
|
||||
return;
|
||||
default:
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#tabs_user_list a").click(function(){
|
||||
load_list($(this).attr('filter'));
|
||||
$(this).tab('show');
|
||||
});
|
||||
});
|
||||
|
||||
function loadAjaxContent(url) {
|
||||
var dataTmp;
|
||||
$.get(url, function (data) {
|
||||
dataTmp = data;
|
||||
bodyelem = $("html,body");
|
||||
bodyelem.animate();
|
||||
}).complete(function() {
|
||||
$('#site-content-wrapper').slideUp({duration: 'slow',
|
||||
complete: function(){
|
||||
$('#site-content').html(dataTmp);
|
||||
$('#site-content-wrapper').slideDown('slow');
|
||||
site_content_is_visible = true;
|
||||
}});
|
||||
});
|
||||
function load_list(filter){
|
||||
$('#contentframe').load('./?page=get_list&filter=' + filter, function(){
|
||||
|
||||
});
|
||||
}
|
||||
@ -2,4 +2,7 @@
|
||||
class page_neopolimatrix extends \SYSTEM\API\api_default {
|
||||
public static function default_page(){
|
||||
return new default_page();}
|
||||
|
||||
public static function page_get_list($filter){
|
||||
return new default_list($filter);}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user