| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
This program is free software; you can redistribute it and/or |
| 5 |
modify it under the terms of the GNU General Public License |
| 6 |
as published by the Free Software Foundation; either version 2 |
| 7 |
of the License, or (at your option) any later version. |
| 8 |
|
| 9 |
This program is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
GNU General Public License for more details. |
| 13 |
|
| 14 |
You should have received a copy of the GNU General Public License |
| 15 |
along with this program; if not, write to the Free Software |
| 16 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 |
|
| 18 |
Copyright 2017 Buttonizer |
| 19 |
*/ |
| 20 |
namespace Buttonizer\Admin; |
| 21 |
|
| 22 |
# No script kiddies |
| 23 |
defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
| 24 |
class PageCategories |
| 25 |
{ |
| 26 |
private $aSavedData = array() ; |
| 27 |
private $aAllPages = array() ; |
| 28 |
public function __construct() |
| 29 |
{ |
| 30 |
$this->loadData(); |
| 31 |
$this->loadCategories(); |
| 32 |
} |
| 33 |
|
| 34 |
private function loadData() |
| 35 |
{ |
| 36 |
$this->aSavedData = (array) get_option( 'buttonizer_page_categories' ); |
| 37 |
} |
| 38 |
|
| 39 |
private function loadCategories() |
| 40 |
{ |
| 41 |
// Get buttons |
| 42 |
$aCategories = $this->aSavedData; |
| 43 |
echo '<div id="page-categories">' ; |
| 44 |
// Not removable button row |
| 45 |
echo '<div class="button-row is_category"> |
| 46 |
<div class="row-info"> |
| 47 |
<span><i class="fa fa-file-text-o"></i> All pages</span> |
| 48 |
<a href="javascript:void(0)" class="delete-button" style="opacity: 0.5">Delete <i class="fa fa-trash-o"></i></a> |
| 49 |
</div> |
| 50 |
|
| 51 |
<div class="button-data"> |
| 52 |
When a button is set on \'All pages\', the button will shown on all pages. <br /> |
| 53 |
<br /> |
| 54 |
You cannot edit the \'All pages\' item. |
| 55 |
</div> |
| 56 |
</div>' ; |
| 57 |
echo '<script>jQuery("h2 #new-button").click(buttonizer.proInfoWindow);</script><div class="buttonizer-pro-text" style="text-align: center"><i class="fa fa-lock"></i> You are missing the fun! When upgrading to <a href="admin.php?page=Buttonizer-pricing">Buttonizer Pro</a> you will unlock page rules. Look at an example how it works:</div>' ; |
| 58 |
echo '<img src="https://i.gyazo.com/a9f311ff026963d7c5d5f5234856d4f1.gif" style="display: block; margin: 0px auto; max-width: 100%;" />' ; |
| 59 |
echo '</div>' ; |
| 60 |
echo '<script>buttonizer.categories.initialize(/* READY */);</script>' ; |
| 61 |
} |
| 62 |
|
| 63 |
private function loadIndividialCategoryRow( $iCategoryId, $categoryData ) |
| 64 |
{ |
| 65 |
} |
| 66 |
|
| 67 |
} |