first commit

This commit is contained in:
2023-09-04 21:59:34 +02:00
commit 650ef5b3e1
196 changed files with 24080 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<div class="browse">
<?
if ( is_array( $this -> _articles ) )
{
?>
<table class='table_browse'>
<thead>
<tr>
<td class='title' style='width: 15px; text-align:center;'>Lp.</td>
<td class='title'>Tytuł</td>
<td class='title' style="text-align: center; width: 150px;">Data modyfikacji</td>
<td class='title' style='width: 15px;'></td>
</tr>
</thead>
<tbody>
<?
foreach ( $this -> _articles as $article )
{
?>
<tr>
<td class='cell' style='text-align:center;'><?= ++$i;?>.</td>
<td class='cell'><?= $article -> _values['title'];?></td>
<td class="cell" style="text-align: center;">
<?= date( 'Y-m-d H:i', strtotime( $article -> _values['date_modify'] ) );?>
</td>
<td class='cell'>
<a href="./?page_type=page_articles&rw=edit&id=<?= $article -> _values['id'];?>">
<span class='icon edit'></span>
</a>
</td>
</tr>
<?
}
?>
</tbody>
</table>
<?
}
else
echo '<div id="alert" class="alert" style="margin: 0px; width: 100%; border: 0px; text-align: center;">Brak przypisanych artykułów.</div>';
?>
</div>

View File

@@ -0,0 +1,148 @@
<ul id="myMenu-page" class="contextMenu">
<li class="edit"><a href="#add_subpage">Dodaj podstronę</a></li>
<li class="edit"><a href="#edit">Edytuj stronę</a></li>
<li class="delete"><a href="#delete">Usuń stronę</a></li>
<li class="edit"><a href="#show_articles">Pokaż artykuły</a></li>
<li class="quit separator"><a href="#cancel">Anuluj</a></li>
</ul>
<ul id="myMenu-menu" class="contextMenu">
<li class="edit"><a href="#edit_menu">Edytuj menu</a></li>
<li class="edit"><a href="#delete_menu">Usuń menu</a></li>
<li class="edit"><a href="#add_page">Dodaj stronę</a></li>
<li class="quit separator"><a href="#cancel">Anuluj</a></li>
</ul>
<div class="action-icons">
<a class="button button_add" href="./?rw=add_menu">Dodaj menu</a>
</div>
<div class="edit-row">
<? if ( is_array( $this -> _menu ) ):?>
<? foreach ( $this -> _menu as $menu ):?>
<div class="menu_sortable">
<ol class="sortable" id="sortable_<?= $menu['id'];?>">
<li id="list_<?= $menu['id'];?>" class="menu_<?= $menu['id'];?>" menu="<?= $menu['id'];?>">
<div class="context_0 content content_menu" <? if ( !$menu['enabled'] ) echo 'style="color: #cc0000;"';?>>
<span class="disclose"><span></span></span>
Menu: <b><?= $menu['name'];?></b>
</div>
<?= \admin\view\Pages::drawSubpages( \admin\factory\Pages::getPages( $menu['id'] ) );?>
</li>
</ol>
</div>
<? endforeach;?>
<? endif;?>
</div>
<script type="text/javascript">
var parent_id = 0;
var menu_id = 0;
$( document ).ready( function() {
$('ol.sortable').nestedSortable({
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
opacity: .6,
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
maxLevels: 3,
isTree: true,
expandOnHover: 700,
saveAfterDrag: true
});
$('.disclose').on('click', function() {
$(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
});
$( ".content_page, .content_menu" ).mousedown(function(e) {
if (e.which === 3 || e.which == 1 ) {
parent_id = $( this ).parent( 'li' ).attr( 'idk' );
menu_id = $( this ).parent( 'li' ).attr( 'menu' );
}
});
$( '.context_0' ).contextMenu( { menu: "myMenu-menu" }, function( action ) {
switch( action ) {
case 'add_page':
document.location.href='./?rw=add&parent_id=0&menu_id=' + menu_id;
break;
case 'edit_menu':
document.location.href='./?rw=edit_menu&id=' + menu_id;
break;
case 'delete_menu':
$.prompt( "Na pewno chcesz usunąć wybrane menu?", {
title: "Potwierdź?",
buttons: { "Tak": true, "Nie": false },
submit: function(e,v,m,f){
if ( v == true )
document.location.href='./?rw=del_menu&id=' + menu_id;
}
});
break;
case 'cancel': break;
}
});
$( '.content_page' ).contextMenu( { menu: "myMenu-page" }, function( action ) {
switch( action ) {
case 'add_subpage':
document.location.href='./?rw=add&parent_id=' + parent_id + '&menu_id=' + menu_id;
break;
case 'edit':
document.location.href='./?rw=edit&id=' + parent_id + '&menu_id=' + menu_id;
break;
case 'show_articles':
document.location.href='./?rw=article_list&id=' + parent_id;
break;
case 'delete':
$.prompt( "Na pewno chcesz usunąć wybraną stronę?", {
title: "Potwierdź?",
buttons: { "Tak": true, "Nie": false },
submit: function(e,v,m,f){
if ( v == true )
document.location.href='./?rw=del&id=' + parent_id;
}
});
break;
case 'cancel': break;
}
});
$( '.disclose' ).mousedown(function(e) {
if ( e.which === 1 ) {
if ( $( this ).parent( 'div' ).hasClass( 'content_menu' ) )
xajax_saveMenuCookie( $( this ).parent( 'div' ).parent( 'li' ).attr( 'menu' ) );
else
xajax_savePagesCookie( $( this ).parent( 'div' ).parent( 'li' ).attr( 'id' ) );
}
});
<?
$array = unserialize( $_COOKIE[ 'pages_definition' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
$array = unserialize( $_COOKIE[ 'menu_definition' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.menu_<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
?>
});
function saveChanges( ) {
arraied = $( '#sortable_' + menu_id ).nestedSortable( 'toArray', { startDepthCount: 0 } );
$.prompt( 'Trwa zapisywanie...', { title: 'Proszę czekać' } );
xajax_savePageOrder( arraied, menu_id );
}
</script>

View File

@@ -0,0 +1,286 @@
<style type="text/css">
.ui-widget-content {
background: none !important;
border: none !important;
}
.ui-widget-header {
border: none !important;
background: none !important;
}
.ui-widget {
font-family: inherit !important;
}
.ui-tabs .ui-tabs-panel {
padding: 0px !important;
}
.ui-tooltip {
background: #FFF;
border-radius: 0;
border: 1px solid #D1D4D7 !important;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
color: #656565;
font-size: 11px;
}
</style>
<script>
$(document).ready(function() {
$( '#slider-code' ).tinycarousel({
pager: true
});
$( ".tabs a" ).click( function ()
{
$( ".tabs .active" ).removeClass( "active" );
$( this ).addClass( "active" );
$( ".tabs-content" ).addClass( 'nondisplay' );
var content_show = $( this ).attr( "href" );
$( '#' + content_show ).removeClass( 'nondisplay' );
return false;
});
<? if ( $this -> _rw == 'add' ):?>
$( "#id_page_type" ).val( '2' );
<? endif;?>
changePageType();
});
function changePageType()
{
var type = $("#id_page_type").val();
if ( type == 5 || type == 6 || type == 7 || type == 8 || type == 9 || type == 10 || type == 11 )
{
$( '#div_article_number, #div_sort_type' ).hide();
if ( type == 8 )
{
$( '#div_show_title' ).hide();
$( '#div_link' ).show();
}
else
{
$( '#div_link' ).hide();
$( '#div_show_title' ).show();
}
}
else
{
$( '#div_article_number, #div_sort_type' ).show();
$( '#div_link' ).hide();
$( '#div_show_title' ).show();
}
}
</script>
<div class="edit-row">
<form method='POST' id='formularz' action='./'>
<? if ( $this -> _rw == 'edit' ):?>
<input type='hidden' name='rw' value='save' />
<input type='hidden' name='id' value='<?= $this -> _page['id'];?>' />
<? else:?>
<input type='hidden' name='rw' value='add_new' />
<input type='hidden' name='check' value='<?= time();?>' />
<? endif;?>
<input type='hidden' name='o' value='<?= $this -> _order;?>' />
<input type='hidden' name='menu_id' value='<?= $this -> _menu_id;?>' />
<div id="slider-code">
<ul class="pager">
<li><a rel="0" class="pagenum" href="#"><span class="badge">1</span>Ustawienia podstawowe</a></li>
<li><a rel="1" class="pagenum" href="#"><span class="badge">2</span>Ustawienia zaawansowane</a></li>
</ul>
<a class="buttons prev tip" href="#" title="Wstecz">
<img src="../../images/system/img-left.png" />
</a>
<div class="viewport">
<ul class="overview">
<li>
<div class="slide-title">Ustawienia podstawowe</div>
<div id="tabs" class="tabs-container">
<ul class="tabs">
<?
if ( is_array( $this -> _language ) ) foreach ( $this -> _language as $lg )
{
?>
<li class="tab-li">
<a href="lang_<?=$lg['id'];?>" class="li-tabs <? if ( !$j++ ) echo 'active';?>"><?= $lg['name'];?></a>
</li>
<?
}
?>
</ul>
<?
if ( is_array( $this -> _language ) ) foreach ( $this -> _language as $lg )
{
?>
<div id="lang_<?= $lg['id'];?>" class="tabs-content <? if ( $i++ ) echo 'nondisplay';?>">
<div class="group">
<label>Tytuł:</label>
<div class="content">
<input type='text' name='title_<?= $lg['id'];?>' id='title_<?= $lg['id'];?>' value='<?= $this -> secureHTML( $lg['title'] );?>' />
</div>
</div>
<div class="group">
<label>Link SEO:</label>
<div class="content">
<input type='text' name='seo_link_<?= $lg['id'];?>' id='seo_link_<?= $lg['id'];?>' value='<?= $this -> secureHTML( $lg['seo_link'] );?>' />
<a href="#" onclick="xajax_generateSeoLink( '<?= $lg['id'];?>', $( '#title_<?= $lg['id'];?>' ).val() )">
<i class="icon refresh" style="position: relative; top: 3px; margin: 0;"></i>
generuj
</a>
</div>
</div>
<div class="group">
<label>Meta title:</label>
<div class="content">
<input type='text' name='meta_title_<?= $lg['id'];?>' id='title_<?= $lg['id'];?>' value='<?= $this -> secureHTML( $lg['meta_title'] );?>' />
</div>
</div>
<div class="group">
<label>Meta description:</label>
<div class="content">
<textarea name='meta_description_<?= $lg['id'];?>' cols='60' rows='5'><?= $this -> secureHTML( $lg['meta_description'] );?></textarea>
</div>
<div class="clearfix"></div>
</div>
<div class="group">
<label>Meta keywords:</label>
<div class="content">
<textarea name='meta_keywords_<?= $lg['id'];?>' cols='60' rows='5'><?= $this -> secureHTML( $lg['meta_keywords'] );?></textarea>
</div>
<div class="clearfix"></div>
</div>
</div>
<?
}
?>
</div>
</li>
<li>
<div class="slide-title">Ustawienia zaawansowane</div>
<div class="tabs-container">
<div class="group">
<label>Menu:</label>
<div class="content">
<select name='menu_id' id='menu_id'>
<? if ( is_array( $this -> _menu ) ):?>
<? foreach ( $this -> _menu as $menu ):?>
<option value="<?= $menu['id'];?>" <? if ( $menu['id'] == $this -> _page['id_menu'] ):?>selected="selected"<? endif;?>><?= $menu['name'];?></option>
<? endforeach;?>
<? endif;?>
</select>
</div>
</div>
<div class="group">
<label>Strona nadrzędna:</label>
<div class="content">
<select name='parent_id' id='parent_id'>
<option value="0">---- pozycja główna ----</option>
<?
echo \admin\view\Pages::drawSubpagesEdit( $this -> _pages, $this -> _parent_id, $this -> _step, $this -> _id );
?>
</select>
</div>
</div>
<div class="group">
<label>Typ strony:</label>
<div class="content">
<select name='page_type_id' id='id_page_type' onChange='changePageType()'>
<?
if ( is_array ( $this -> _page_types ) ) foreach ( $this -> _page_types as $page_type )
{
?>
<option value='<?=$page_type['id'];?>' <? if ( $this -> _page['id_page_type'] == $page_type['id'] ) echo "selected='selected'"; ?>>
<?= $page_type['name'];?>
</option>
<?
}
?>
</select>
</div>
</div>
<div class="group" id="div_sort_type">
<label>Kolejność wyświetlania:</label>
<div class="content">
<select name='sort_type'>
<?
if ( is_array( $this -> _sort ) ) foreach ( $this -> _sort as $sort )
{
?>
<option value='<?=$sort['id'];?>' <? if ( $this -> _page['id_sort_type'] == $sort['id'] ) echo "selected='selected'";?>>
<?= $sort['name'];?>
</option>
<?
}
?>
</select>
</div>
</div>
<div class="group">
<label>Szablon</label>
<div class="content">
<select name="layout_id">
<option value="">---- szablon domyślny ----</option>
<? if ( is_array( $this -> _layouts ) ): foreach ( $this -> _layouts as $layout ):?>
<option value="<?= $layout['id'];?>" <? if ( $this -> _layout_id == $layout['id'] ):?>selected="selected"<? endif;?>><?= $layout['name'];?></option>
<? endforeach; endif;?>
</select>
</div>
</div>
<div class="group" id="div_article_number">
<label>Liczba artykułów:</label>
<div class="content">
<input type='text' name='article_number' value='<?= $this -> _page['article_number'] ? $tmp = $this -> _page['article_number'] : $tmp = '2';?>' />
</div>
</div>
<div class="group" id="div_show_title">
<label>Pokaż tytuł:</label>
<div class="content">
<input type="radio" name='show_title' id="show_title_0" value="0" <? if ( !$this -> _page['show_title'] ) echo "checked='checked'";?> />
nie
<input type="radio" name="show_title" value="1" <? if ( $this -> _page['show_title'] || $this -> _rw == 'add' ) echo "checked='checked'";?> />
tak
</div>
</div>
<div class="group">
<label>Aktywna:</label>
<div class="content">
<input type="radio" name="enabled" id="enabled_0" value="0" <? if ( !$this -> _page['enabled'] ) echo "checked='checked'";?> />
nie
<input type="radio" name="enabled" id="enabled_1" value='1' <? if ( $this -> _page['enabled'] || $this -> _rw == 'add' ) echo "checked='checked'";?> />
tak
</div>
</div>
<div class="group">
<label>Tylko dla zalogowanych:</label>
<div class="content">
<input type="radio" name="only_for_logged" id="only_for_logged_0" value="0" <? if ( !$this -> _page['only_for_logged'] ) echo "checked='checked'";?> />
nie
<input type="radio" name="only_for_logged" id="only_for_logged_1" value='1' <? if ( $this -> _page['only_for_logged'] ) echo "checked='checked'";?> />
tak
</div>
</div>
<div class="group">
<label>Podłącz formularz kontaktowy:</label>
<div class="content">
<input type="radio" name="contact_form" id="contact_form_0" value="0" <? if ( !$this -> _page['contact_form'] ) echo "checked='checked'";?> />
nie
<input type="radio" name="contact_form" id="contact_form_1" value='1' <? if ( $this -> _page['contact_form'] ) echo "checked='checked'";?> />
tak
</div>
</div>
<div class="group" id="div_link" style="display: none;">
<label>Link:</label>
<div class="content">
<input type="text" name="link" value="<?= $this -> _page['link'];?>">
</div>
</div>
</div>
</li>
</ul>
</div>
<a class="buttons next tip" href="#" title="Dalej">
<img src="../../images/system/img-right.png" />
</a>
</div>
</form>
</div>

View File

@@ -0,0 +1,15 @@
<?php
if ( is_array ( $this -> _pages ) ) foreach ( $this -> _pages as $page )
{
if ( $this -> _this_id !== $page['id'] )
{
?>
<option value='<?=$page['id'];?>' <? if ( $this -> _parent_id == $page['id'] ) echo "selected='selected'"; ?>>
<? for ( $i = 0; $i < 3 * $this -> _step; $i++ ) echo '&nbsp;'; echo $page['title'];?>
</option>
<?
}
if ( is_array( $page['subpages'] ) )
echo \admin\view\Pages::drawSubpagesEdit( $page['subpages'], $this -> _parent_id, $this -> _step + 1, $this -> _this_id );
}
?>

View File

@@ -0,0 +1,16 @@
<? if ( is_array( $this -> _pages ) ):?>
<ol>
<? foreach ( $this -> _pages as $page ):?>
<li id="list_<?= $page['id'];?>" idk="<?= $page['id'];?>" class="list_<?= $page['id'];?>" menu="<?= $page['id_menu'];?>">
<div class="content content_page" <? if ( !$page['enabled'] ) echo 'style="color: #cc0000;"';?>>
<span class="disclose"><span></span></span>
<?= $page['title'];?>
</div>
<?
if ( is_array( $page['subpages'] ) )
echo \admin\view\Pages::drawSubpages( $page['subpages'], $page['id'] );
?>
</li>
<? endforeach;?>
</ol>
<? endif;?>