Cambios
git-svn-id: https://192.168.0.254/svn/Proyectos.OriginalHouse_Web/trunk@4 54e8636e-a86c-764f-903d-b964358a1ae2
968
db/originalhouse.sql
Normal file
BIN
información/TT0200M_.TTF
Normal file
BIN
información/fondos actuales/fondo-inicio.jpg
Normal file
|
After Width: | Height: | Size: 200 KiB |
BIN
información/fondos actuales/fondo-la-tienda.jpg
Normal file
|
After Width: | Height: | Size: 325 KiB |
BIN
información/fondos actuales/fondo-localizanos.jpg
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
información/fondos actuales/fondo-servicios.jpg
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
información/logo.gif
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
información/logo.psd
Normal file
BIN
información/tarjeta de visita.psd
Normal file
|
After Width: | Height: | Size: 419 KiB |
|
After Width: | Height: | Size: 448 KiB |
|
After Width: | Height: | Size: 425 KiB |
BIN
referencia/iconos/full-screen-icon.png
Normal file
|
After Width: | Height: | Size: 705 B |
BIN
referencia/iconos/full-set.zip
Normal file
BIN
referencia/plantillas/savinggrace.zip
Normal file
5
src/nbproject/private/private.properties
Normal file
@ -0,0 +1,5 @@
|
||||
copy.src.files=false
|
||||
copy.src.target=
|
||||
index.file=index.php
|
||||
run.as=LOCAL
|
||||
url=http://localhost/originalhouse/
|
||||
6
src/nbproject/private/private.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
|
||||
<file>file:/D:/Trabajo/OriginalHouse/trunk/src/index.php</file>
|
||||
</open-files>
|
||||
</project-private>
|
||||
7
src/nbproject/project.properties
Normal file
@ -0,0 +1,7 @@
|
||||
include.path=${php.global.include.path}
|
||||
php.version=PHP_5
|
||||
source.encoding=ISO-8859-1
|
||||
src.dir=.
|
||||
tags.asp=false
|
||||
tags.short=true
|
||||
web.root=.
|
||||
9
src/nbproject/project.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.php.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
||||
<name>Original House</name>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
123
src/wp-content/plugins/catablog/catablog.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: CataBlog
|
||||
Plugin URI: http://catablog.illproductions.com/
|
||||
Description: CataBlog is a comprehensive and effortless tool that helps you create, organize and share catalogs, stores, galleries and portfolios on your blog.
|
||||
Version: 1.2.9.7
|
||||
Author: Zachary Segal
|
||||
Author URI: http://catablog.illproductions.com/about/
|
||||
|
||||
Copyright 2011 Zachary Segal (email : zac@illproductions.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Make sure we don't expose any info if called directly
|
||||
if ( !function_exists( 'add_action' ) ) {
|
||||
echo "Hi there! I'm just a plugin, not much I can do when called directly.";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Global variable to hold the catablog class.
|
||||
// Always reference this variable instead of instantiating a new CataBlog class.
|
||||
global $wp_plugin_catablog_class;
|
||||
|
||||
|
||||
|
||||
// Load the CataBlog WordPress plugin if PHP is version 5.0 or above
|
||||
function catablog_load_plugin() {
|
||||
|
||||
// load necessary libraries
|
||||
require('lib/CataBlog.class.php');
|
||||
require('lib/CataBlogItem.class.php');
|
||||
require('lib/CataBlogDirectory.class.php');
|
||||
|
||||
// create CataBlog class and hook into WordPress
|
||||
global $wp_plugin_catablog_class;
|
||||
$wp_plugin_catablog_class = new CataBlog();
|
||||
$wp_plugin_catablog_class->registerWordPressHooks();
|
||||
|
||||
/**
|
||||
* Template function to emulate the CataBlog Shortcode behavior.
|
||||
* This function will echo out your catalog.
|
||||
*
|
||||
* @param string $category A list of CataBlog category names separated by commas
|
||||
* @param string $template A CataBlog template file name
|
||||
* @param string $sort The column to sort your catalog by, defaults to menu_order
|
||||
* @param string $order The order to sort your catalog by, default to ascending
|
||||
* @param string $operator The operator to apply to the categories passed in, defaults to IN
|
||||
* @return void
|
||||
*/
|
||||
function catablog_show_items($category=null, $template=null, $sort='menu_order', $order='asc', $operator='IN') {
|
||||
global $wp_plugin_catablog_class;
|
||||
$wp_plugin_catablog_class->frontend_init(true);
|
||||
echo $wp_plugin_catablog_class->frontend_content(array('category'=>$category, 'template'=>$template, 'sort'=>$sort, 'order'=>$order, 'operator'=>$operator));
|
||||
}
|
||||
|
||||
/**
|
||||
* Template function for fetching a single catalog item by id
|
||||
*
|
||||
* @param integer $id The id of a catalog item to fetch
|
||||
* @return CataBlogItem|NULL Returns a CataBlogItem object if a catalog item was found, otherwise NULL
|
||||
*/
|
||||
function catablog_get_item($id=false) {
|
||||
if (is_numeric($id) && $id > 0) {
|
||||
return CataBlogItem::getItem($id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
if (version_compare(phpversion(), '5.0.0', '>=')) {
|
||||
catablog_load_plugin();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Test that the system meets all requirements on activation
|
||||
function catablog_activate() {
|
||||
|
||||
// check if PHP is version 5
|
||||
if (version_compare(phpversion(), '5.0.0', '<')) {
|
||||
wp_die(__("<strong>CataBlog</strong> requires <strong>PHP 5</strong> or better running on your web server. You're version of PHP is to old, please contact your hosting company or IT department for an upgrade. Thanks.", 'catablog'));
|
||||
}
|
||||
|
||||
// check if GD Library is loaded in PHP
|
||||
if (!extension_loaded('gd') || !function_exists('gd_info')) {
|
||||
wp_die(__("<strong>CataBlog</strong> requires that the <strong>GD Library</strong> be installed on your web server's version of PHP. Please contact your hosting company or IT department for more information. Thanks.", 'catablog'));
|
||||
}
|
||||
|
||||
// check WordPress version
|
||||
if (version_compare(get_bloginfo('version'), '3.1', '<')) {
|
||||
wp_die(__("<strong>CataBlog</strong> requires <strong>WordPress 3.1</strong> or above. Please upgrade WordPress or contact your system administrator about upgrading.", 'catablog'));
|
||||
}
|
||||
|
||||
// check if the wp uploads folder is writable
|
||||
$uploads_dir = wp_upload_dir();
|
||||
if ($uploads_dir['error'] !== false) {
|
||||
wp_die(__("<strong>CataBlog</strong> could not detect your upload directory or it is not writable by PHP. Please make sure Apache and PHP have write permission for the configured uploads folder. Contact your hosting company or IT department for more information. Thanks.", 'catablog'));
|
||||
}
|
||||
}
|
||||
register_activation_hook( __FILE__, 'catablog_activate' );
|
||||
|
||||
|
||||
|
||||
// Remote post on deactivation
|
||||
function catablog_deactivate() {
|
||||
$body_array = array('action'=>'deactivate', 'site-url'=>site_url(), 'version'=>'1.2.9.7');
|
||||
$post_action = wp_remote_post('http://catablog.illproductions.com/tracker.php', array('body'=>$body_array));
|
||||
}
|
||||
register_deactivation_hook( __FILE__, 'catablog_deactivate' );
|
||||
|
||||
891
src/wp-content/plugins/catablog/css/catablog-admin.css
Normal file
@ -0,0 +1,891 @@
|
||||
body {
|
||||
/* min-width: 900px !important;*/
|
||||
}
|
||||
|
||||
|
||||
.error {
|
||||
background-color: #FFEBE8;
|
||||
padding: 0 0.6em;
|
||||
border: 1px #C00 solid;
|
||||
}
|
||||
|
||||
th.catablog-sortable {
|
||||
cursor: pointer;
|
||||
background-image: url('./../images/sort.gif');
|
||||
background-position: right center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#catablog_items tr {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#catablog_items.sort_enabled tr,
|
||||
#catablog_items.sort_enabled li {
|
||||
cursor: move !important;
|
||||
background-color: #f6f6f6 !important;
|
||||
}
|
||||
#catablog_items.sort_enabled tr:hover,
|
||||
#catablog_items.sort_enabled li:hover {
|
||||
background-color: #fee !important;
|
||||
}
|
||||
#catablog_items.sort_enabled a {
|
||||
cursor: move !important;
|
||||
}
|
||||
#catablog_items.sort_enabled div.row-actions {
|
||||
display: none !important;
|
||||
}
|
||||
#catablog_items.sort_enabled tr th.check-column {
|
||||
background: transparent url('./../images/drag-handle.png') no-repeat scroll center center;
|
||||
}
|
||||
|
||||
|
||||
#catablog-view-switch #view-switch-list {
|
||||
background-image: url('./../images/catablog-switch-view.png') !important;
|
||||
}
|
||||
#catablog-view-switch #view-switch-list.current {
|
||||
background-position: -40px;
|
||||
}
|
||||
#catablog-view-switch #view-switch-excerpt {
|
||||
background-image: url('./../images/catablog-switch-view.png') !important;
|
||||
}
|
||||
#catablog-view-switch #view-switch-excerpt.current {
|
||||
background-position: -60px;
|
||||
}
|
||||
|
||||
|
||||
#icon-catablog {
|
||||
-moz-background-clip: border;
|
||||
-moz-background-inline-policy: continuous;
|
||||
-moz-background-origin: padding;
|
||||
background: transparent url('./../images/catablog-icon-32.png') no-repeat scroll left top;
|
||||
}
|
||||
|
||||
.cb_order_column {
|
||||
width: 1px;
|
||||
text-align: center !important;
|
||||
}
|
||||
.cb_icon_column {
|
||||
width: 80px;
|
||||
text-align: center !important;
|
||||
}
|
||||
.cb_item_icon {
|
||||
display: block;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 0 none;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.cb_disabled_link {
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
.column-rm {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#catablog-category-add-checklist {
|
||||
float: left;
|
||||
padding: 0.5%;
|
||||
width: 48%;
|
||||
border: 1px #e2e2e2 solid;
|
||||
}
|
||||
#catablog-category-remove-checklist {
|
||||
margin-left: 50%;
|
||||
margin-bottom: 1em;
|
||||
padding: 0.5%;
|
||||
width: 48%;
|
||||
border: 1px #e2e2e2 solid;
|
||||
}
|
||||
#catablog-category-add-checklist strong.list-title,
|
||||
#catablog-category-remove-checklist strong.list-title {
|
||||
display: block;
|
||||
padding: 0.5em;
|
||||
background: #f3f3f3;
|
||||
border-bottom: 1px #e7e7e7 solid;
|
||||
}
|
||||
#catablog-category-add-checklist ul,
|
||||
#catablog-category-remove-checklist ul {
|
||||
height: 13em;
|
||||
margin: 0px !important;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#catablog-edit {
|
||||
position: relative;
|
||||
}
|
||||
#catablog-edit-main {
|
||||
float: left;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin: 0 -265px 0 0;
|
||||
}
|
||||
#catablog-edit-main-content {
|
||||
margin: 0 265px 0 0;
|
||||
}
|
||||
#catablog-edit-params {
|
||||
float: right;
|
||||
clear: right;
|
||||
position: relative;
|
||||
width: 250px;
|
||||
margin: 0 0 0 auto;
|
||||
}
|
||||
#catablog-edit-params input.text-field {
|
||||
width: 100%;
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
#catablog-edit-params input.file-field {
|
||||
width: 96%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-edit-main-text {
|
||||
margin: 0 0 0 135px;
|
||||
border-width: 0 !important;
|
||||
padding: 0 0 9px 9px !important;
|
||||
}
|
||||
#catablog-edit-main-text input {
|
||||
width: 100%;
|
||||
font-size: 18px;
|
||||
line-height: 20px;
|
||||
padding: 3px;
|
||||
color: #464646;
|
||||
}
|
||||
#catablog-edit-main-text textarea {
|
||||
width: 100%;
|
||||
height: 30em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-edit-main-image {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin: 0;
|
||||
width: 135px;
|
||||
border: 0 none !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
#catablog-edit-main-image img.catablog-image-preview {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
#catablog-edit-main-image input {
|
||||
display: block;
|
||||
}
|
||||
#catablog-edit-image-controls {
|
||||
text-align: left;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
#catablog-edit-images-column {
|
||||
background-color: #fff;
|
||||
border: 1px #dfdfdf solid !important;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#catablog-edit-images-column hr {
|
||||
background: #dfdfdf;
|
||||
height: 1px;
|
||||
border: 0 none;
|
||||
}
|
||||
|
||||
#catablog-sub-images {
|
||||
position: relative;
|
||||
width: 100px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
border: 0 none;
|
||||
list-style:none;
|
||||
}
|
||||
#catablog-sub-images li {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0 0 5px 0;
|
||||
cursor: move;
|
||||
}
|
||||
#catablog-sub-images li img {
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0 none;
|
||||
}
|
||||
.catablog-delete-subimage {
|
||||
display: block;
|
||||
display: none;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
line-height: 22px;
|
||||
font-size: 16px;
|
||||
padding: 0 4px 0 5px;
|
||||
text-decoration: none;
|
||||
border: 1px #d00 solid;
|
||||
color: #d00;
|
||||
cursor: pointer;
|
||||
}
|
||||
#catablog-sub-images li:hover .catablog-delete-subimage {
|
||||
display: block;
|
||||
}
|
||||
.catablog-sub-image-trash {
|
||||
display: block;
|
||||
width: 49px;
|
||||
height: 49px;
|
||||
margin: 2px 2px 0 0;
|
||||
background-color: #fee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#edit-category-window {
|
||||
top: 60px;
|
||||
}
|
||||
.catablog-modal {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 120px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
z-index: 1001;
|
||||
}
|
||||
.catablog-modal form {
|
||||
width: 550px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.catablog-modal form h3.catablog-modal-title {
|
||||
background-image: url('./../images/gray-grad.png');
|
||||
border: 1px solid #DDD;
|
||||
color: #464646;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin: 0px;
|
||||
padding: 6px;
|
||||
|
||||
-moz-border-radius: 6px 6px 0 0;
|
||||
border-radius: 6px 6px 0 0;
|
||||
|
||||
-moz-box-shadow: 2px 2px 6px #333;
|
||||
-webkit-box-shadow: 2px 2px 6px #333;
|
||||
box-shadow: 2px 2px 6px #333;
|
||||
}
|
||||
.catablog-modal form div.catablog-modal-body {
|
||||
border: solid #DDD;
|
||||
border-width: 0px 1px 1px;
|
||||
padding: 9px;
|
||||
background-color: #fff;
|
||||
|
||||
-moz-border-radius: 0 0 6px 6px;
|
||||
border-radius: 0 0 6px 6px;
|
||||
|
||||
-moz-box-shadow: 2px 2px 6px #333;
|
||||
-webkit-box-shadow: 2px 2px 6px #333;
|
||||
box-shadow: 2px 2px 6px #333;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-edit-main-image #select-image-button {
|
||||
width: 100px;
|
||||
height: 31px;
|
||||
margin: 10px 0;
|
||||
background: url('./../images/catablog-admin-select-image.png') 0 0 no-repeat;
|
||||
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
|
||||
}
|
||||
#catablog-edit-main-image #new_image {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: auto;
|
||||
cursor: pointer;
|
||||
|
||||
opacity: 0;
|
||||
-moz-opacity: 0;
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-edit-main-image #catablog-edit-main-image strong {
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
#catablog-edit-main-image #no-image-icon {
|
||||
width: 98px;
|
||||
height: 38px;
|
||||
line-height: 15px;
|
||||
padding: 30px 0;
|
||||
border: 1px #ddd solid;
|
||||
background-color: #ededed;
|
||||
background-image: url('./../images/gray-grad.png');
|
||||
background-position: left bottom;
|
||||
background-repeat: repeat-x;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
color: #900;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.catablog-category-row {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.catablog-category-row.hover {
|
||||
background-color: #ffd;
|
||||
}
|
||||
|
||||
.catablog-category-delete {
|
||||
float: right;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-edit #catablog-new-category {
|
||||
border: 0 none;
|
||||
border-top: 1px #ccc solid;
|
||||
margin: 1em 0 0 0;
|
||||
padding: 1em 0 0 0;
|
||||
}
|
||||
.catablog-category-row span {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#catablog-new-category-submit {
|
||||
float: right;
|
||||
}
|
||||
#catablog-new-category-submit:active {
|
||||
background-color: #555;
|
||||
}
|
||||
#catablog-new-category-load {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 0 0 0 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-edit-main-save {
|
||||
border-width: 0 0 0 0 !important;
|
||||
margin: 0 0 0 145px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-options {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
form#catablog-edit fieldset {
|
||||
padding: 0;
|
||||
margin: 0 0 16px 0;
|
||||
border: 0 none;
|
||||
}
|
||||
form#catablog-edit fieldset h3 {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding: 6px;
|
||||
background-image: url('./../images/gray-grad.png');
|
||||
margin: 0;
|
||||
-moz-border-radius: 6px 6px 0 0;
|
||||
border-radius: 6px 6px 0 0;
|
||||
color: #464646;
|
||||
border: 1px #dfdfdf solid;
|
||||
}
|
||||
form#catablog-edit fieldset div {
|
||||
border: 1px #ddd solid;
|
||||
border-width: 0 1px 1px 1px;
|
||||
padding: 9px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#upload-form-left-col.left-col {
|
||||
float: left;
|
||||
width: 17em;
|
||||
}
|
||||
#upload-form-right-col.right-col {
|
||||
margin: 0 0 0 19em;
|
||||
border: 1px #ccc solid;
|
||||
border-radius: 5px;
|
||||
background: #fcfcfc;
|
||||
}
|
||||
|
||||
#upload-feedback {
|
||||
padding: 1em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#new-items-editor li.error {
|
||||
border: 0;
|
||||
border-top: 1px #c00 solid;
|
||||
}
|
||||
|
||||
#new-items-editor li {
|
||||
display: none;
|
||||
padding: 1em;
|
||||
margin: 0;
|
||||
border-top: 1px #e1e1e1 solid;
|
||||
}
|
||||
|
||||
#new-items-editor li .button-elements {
|
||||
float: left;
|
||||
width: 100px;
|
||||
}
|
||||
#new-items-editor li .button-elements img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-bottom: 6px;
|
||||
border: 1px #dfdfdf solid;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#new-items-editor li .text-elements {
|
||||
margin-left: 112px;
|
||||
min-height: 100px;
|
||||
}
|
||||
#new-items-editor li .text-elements input.title,
|
||||
#new-items-editor li .text-elements textarea.description {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
padding: 2px;
|
||||
margin: 1px 0;
|
||||
}
|
||||
#new-items-editor li .text-elements textarea.description {
|
||||
height: 4em;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#new-items-editor li .text-elements input.button-primary {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-options-menu {
|
||||
float: left;
|
||||
width: 115px;
|
||||
margin: 0 0 0 0;
|
||||
}
|
||||
#catablog-options-menu li a {
|
||||
position: relative;
|
||||
left: 1px;
|
||||
display: block;
|
||||
border: 1px #e7e7e7 solid;
|
||||
background: #e7e7e7;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px 0 0 5px;
|
||||
}
|
||||
#catablog-options-menu li a.selected {
|
||||
background: #fff;
|
||||
border-color: #e7e7e7 #fff #e7e7e7 #e7e7e7;
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.catablog-options-panel {
|
||||
margin: 0 0 0 115px !important;
|
||||
min-height: 340px;
|
||||
padding: 1em;
|
||||
border: 1px #ddd solid;;
|
||||
background-color: #fff;
|
||||
border-radius: 0 3px 3px 3px;
|
||||
}
|
||||
.catablog-options-panel label {
|
||||
font-weight: bold;
|
||||
}
|
||||
.catablog-options-panel > p {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
.catablog-options-panel legend {
|
||||
display: none;
|
||||
}
|
||||
.catablog-options-panel hr {
|
||||
background: #ddd;
|
||||
border: 0 none;
|
||||
border-top: 1px #ddd solid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* CATABLOG OPTIONS - MISC CLASSES AND HELPERS */
|
||||
.catablog-options-panel #thumbnail_preview .demo_box {
|
||||
display: block;
|
||||
position: relative;
|
||||
background-color: #ccc;
|
||||
border: 1px #999 solid !important;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.catablog-options-panel #thumbnail_preview .demo_box img {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 13%;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
.catablog-options-panel #thumbnail_preview .demo_box.crop img {
|
||||
top: 0px;
|
||||
left: -12%;
|
||||
width: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.catablog-options-panel a.catablog-load-code {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.catablog-options-panel textarea.catablog-code {
|
||||
width: 100%;
|
||||
height: 22em;
|
||||
overflow: auto;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog_items.catablog-grid-view {
|
||||
clear: both;
|
||||
}
|
||||
#catablog_items.catablog-grid-view li.clear {
|
||||
clear: left;
|
||||
float: none;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0 none;
|
||||
}
|
||||
#catablog_items.catablog-grid-view li {
|
||||
display: block;
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 100px;
|
||||
border: 3px #eee solid;
|
||||
text-align: center;
|
||||
margin: 5px;
|
||||
background: #fff;
|
||||
vertical-align: top;
|
||||
}
|
||||
#catablog_items.catablog-grid-view li a.catablog-admin-thumbnail {
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
text-decoration: none;
|
||||
margin: 0;
|
||||
}
|
||||
#catablog_items.catablog-grid-view li a.catablog-admin-thumbnail img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: 0;
|
||||
}
|
||||
#catablog_items.catablog-grid-view li a.catablog-title {
|
||||
display: block;
|
||||
height: 2.5em;
|
||||
line-height: 1.4;
|
||||
margin: 0.5em;
|
||||
overflow: hidden;
|
||||
text-decoration: none;
|
||||
}
|
||||
#catablog_items.catablog-grid-view li input.bulk_selection {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
form#catablog-import-export fieldset div.controls {
|
||||
float: left;
|
||||
width: 280px;
|
||||
|
||||
}
|
||||
form#catablog-import-export fieldset div.advice {
|
||||
margin: 0 0 0 300px;
|
||||
border-left: 1px #e3e3e3 solid;
|
||||
padding: 0 0 0 20px;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
form fieldset.disabled {
|
||||
color: #888 !important;
|
||||
}
|
||||
form fieldset.disabled input {
|
||||
color: #888 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
form#catablog-view {}
|
||||
form#catablog-view #catablog-view-menu {
|
||||
display: block;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 3px;
|
||||
margin: 0 0 10px 0;
|
||||
width: 100%;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.catablog-progress {
|
||||
position: relative;
|
||||
height: 3em;
|
||||
line-height: 3em;
|
||||
border: 1px #e8e8e8 solid;
|
||||
background-color: #fff;
|
||||
padding: 0 1em;
|
||||
margin: 0 0 1em 0;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.catablog-progress-text {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.catablog-progress-bar {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height: 100%;
|
||||
width: 0%;
|
||||
background-color: #7dc2fd;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
#catablog-progress-fullsize .catablog-progress-bar {
|
||||
background-color: #fdcb7d;
|
||||
}
|
||||
|
||||
#catablog-console {
|
||||
padding: 1em;
|
||||
border: 1px #e3e3e3 solid;
|
||||
height: 25em;
|
||||
background: #fff;
|
||||
overflow: auto;
|
||||
-moz-border-radius: 1em;
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.ajax-save {
|
||||
padding: 0 1em;
|
||||
line-height: 20px;
|
||||
background-color: transparent;
|
||||
background-image: url('./../images/ajax-loader-small.gif');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog_load_curtain {
|
||||
display: none;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
z-index: 1000;
|
||||
}
|
||||
#catablog_load_display {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 50px;
|
||||
margin: 50px auto 0 auto;
|
||||
padding: 35px 0 0 0;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
background-image: url('./../images/ajax-loader.gif');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#catablog-import-messages li {
|
||||
margin: 0 0 5px 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
table.catablog_stats td {
|
||||
padding: 0 2em 0 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#color-picker-div {
|
||||
z-index: 100;
|
||||
background: #fff;
|
||||
padding: 3px;
|
||||
border: 1px #ccc solid;
|
||||
border-width: 1px 1px 2px 1px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
left: 550px;
|
||||
|
||||
-moz-box-shadow: 1px 1px 5px #333;
|
||||
-webkit-box-shadow: 1px 1px 5px #333;
|
||||
box-shadow: 1px 1px 5px #333;
|
||||
}
|
||||
#pickcolor {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: auto;
|
||||
padding: 0 5px 3px 5px;
|
||||
background: #fff;
|
||||
z-index: 1200;
|
||||
border: 1px #fff solid;
|
||||
}
|
||||
#pickcolor.selected {
|
||||
background-color: #fff;
|
||||
border: 1px #ccc solid;
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
.color-swatch {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
background-color: #fff;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
border: 1px #ccc solid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.clear_float:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear:both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
.warning {
|
||||
color: #c00;
|
||||
text-decoration: underline;
|
||||
}
|
||||
273
src/wp-content/plugins/catablog/css/catablog.css
Normal file
@ -0,0 +1,273 @@
|
||||
/*
|
||||
* CataBlog StyleSheet, version 1.2.5
|
||||
*/
|
||||
|
||||
|
||||
/* Default and Subimages Template CSS Classes */
|
||||
.catablog-row {
|
||||
position: relative;
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
padding: 5px 5px 15px 5px;
|
||||
}
|
||||
.catablog-row .catablog-images-column {
|
||||
float: left;
|
||||
position: relative;
|
||||
}
|
||||
.catablog-row img.catablog-image,
|
||||
.catablog-row .catablog-image img {
|
||||
display: block;
|
||||
height: auto;
|
||||
float: left;
|
||||
}
|
||||
.catablog-row .catablog-images-column .catablog-image img {
|
||||
float: none;
|
||||
}
|
||||
.catablog-row .catablog-image.catablog-subimage {
|
||||
float: left;
|
||||
width: 50%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0 none;
|
||||
|
||||
}
|
||||
.catablog-row .catablog-image.catablog-subimage img {
|
||||
width: 100% !important;
|
||||
}
|
||||
.catablog-row .catablog-title {
|
||||
display: block;
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
clear: none;
|
||||
float: none;
|
||||
}
|
||||
.catablog-row .catablog-description {
|
||||
display: block;
|
||||
clear: none;
|
||||
float: none;
|
||||
}
|
||||
.catablog-row .catablog-description:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
clear: both;
|
||||
height: 0px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* Grid and Gallery Template CSS Classes */
|
||||
.catablog-gallery.catablog-row {
|
||||
display: block;
|
||||
position: relative;
|
||||
float: left;
|
||||
padding: 0;
|
||||
margin: 5px;
|
||||
}
|
||||
.catablog-gallery.catablog-row .catablog-image {
|
||||
display: block;
|
||||
float: none;
|
||||
position: static;
|
||||
}
|
||||
.catablog-gallery.catablog-row .catablog-image img {
|
||||
float: none;
|
||||
}
|
||||
.catablog-gallery.catablog-row:hover .catablog-title {
|
||||
display: block;
|
||||
}
|
||||
.catablog-gallery.catablog-row .catablog-title {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
color: #fff;
|
||||
background: #222;
|
||||
opacity: 0.8;
|
||||
margin: 0 !important;
|
||||
padding: 5px;
|
||||
font-weight: normal;
|
||||
font-size: 1em;
|
||||
}
|
||||
.catablog-gallery.catablog-row .catablog-description {
|
||||
display: none;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
/* Single and Archive view classes */
|
||||
|
||||
|
||||
|
||||
.catablog-credits {
|
||||
display: block;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
height: 0px !important;
|
||||
padding: 0px !important;
|
||||
margin: 0 0 1em 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Deprecated CSS Classes (You Should NOT USE or depend on these Classes)*/
|
||||
.catablog-image.catablog-lightbox,
|
||||
.catablog-subimage.catablog-lightbox {
|
||||
cursor: pointer;
|
||||
}
|
||||
.catablog-image.catablog-lightbox:hover {
|
||||
border-color: red;
|
||||
}
|
||||
.catablog-selected {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* LightBox CSS Classes */
|
||||
#catablog-curtain {
|
||||
display: block;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000;
|
||||
z-index: 10000;
|
||||
-moz-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
#catablog-lightbox {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 50px;
|
||||
left: 0px;
|
||||
z-index: 10200;
|
||||
-moz-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
#catablog-lightbox #catablog-whiteboard {
|
||||
position: relative;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: 0 auto;
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
background-image: none;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
border: 1px #000 solid;
|
||||
border-width: 0 1px 2px 0;
|
||||
}
|
||||
#catablog-lightbox #catablog-whiteboard.loading {
|
||||
background-image: url('./../images/ajax-loader.gif');
|
||||
}
|
||||
#catablog-lightbox-meta {
|
||||
position: relative;
|
||||
display: none;
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
#catablog-lightbox-meta .catablog-lightbox-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
-moz-user-select: normal;
|
||||
-khtml-user-select: normal;
|
||||
user-select: normal;
|
||||
}
|
||||
#catablog-lightbox-meta .catablog-lightbox-desc {
|
||||
position: relative;
|
||||
line-height: 1.5;
|
||||
-moz-user-select: normal;
|
||||
-khtml-user-select: normal;
|
||||
user-select: normal;
|
||||
|
||||
}
|
||||
#catablog-lightbox-image {
|
||||
position: relative;
|
||||
display: none;
|
||||
}
|
||||
#catablog-lightbox-image a {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
width: 50%;
|
||||
text-decoration: none;
|
||||
background: transparent;
|
||||
background-image: url("./../images/blank.gif");
|
||||
}
|
||||
#catablog-lightbox-image a span {
|
||||
display: none;
|
||||
}
|
||||
#catablog-lightbox-image a span:first-letter {
|
||||
border-bottom: 1px #caa solid;
|
||||
}
|
||||
#catablog-lightbox-next:hover span,
|
||||
#catablog-lightbox-prev:hover span,
|
||||
#catablog-lightbox-next:focus span,
|
||||
#catablog-lightbox-prev:focus span {
|
||||
display: block;
|
||||
}
|
||||
#catablog-lightbox-next {
|
||||
right: 0px;
|
||||
outline: 0 none;
|
||||
border: 0 none;
|
||||
}
|
||||
#catablog-lightbox-prev {
|
||||
left: 0px;
|
||||
outline: 0 none;
|
||||
border: 0 none;
|
||||
}
|
||||
#catablog-lightbox-close {
|
||||
display: block;
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: -14px;
|
||||
right: -14px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
background-image: url("./../images/close-lightbox.png");
|
||||
background-position: 0px 0px;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
text-indent: -9999px;
|
||||
outline: 0 none;
|
||||
border: 0 none;
|
||||
}
|
||||
#catablog-lightbox-next .catablog-lightbox-nav-label {
|
||||
right: 0px;
|
||||
bottom: 20px;
|
||||
padding-left: 30px;
|
||||
-moz-border-radius: 30px 0 0 30px;
|
||||
-webkit-border-radius: 30px 0 0 30px;
|
||||
border-radius: 30px 0 0 30px;
|
||||
}
|
||||
#catablog-lightbox-prev .catablog-lightbox-nav-label {
|
||||
left: 0px;
|
||||
top: 20px;
|
||||
padding-right: 30px;
|
||||
-moz-border-radius: 0 30px 30px 0;
|
||||
-webkit-border-radius: 0 30px 30px 0;
|
||||
border-radius: 0 30px 30px 0;
|
||||
}
|
||||
.catablog-lightbox-nav-label {
|
||||
display: none;
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
color: #555;
|
||||
padding: 15px;
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
line-height: 30px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.catablog-lightbox-nav-label:hover {
|
||||
|
||||
}
|
||||
BIN
src/wp-content/plugins/catablog/images/ajax-loader-small.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/wp-content/plugins/catablog/images/ajax-loader.gif
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/wp-content/plugins/catablog/images/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/wp-content/plugins/catablog/images/catablog-icon-16.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/wp-content/plugins/catablog/images/catablog-icon-32.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/wp-content/plugins/catablog/images/catablog-switch-view.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 40 KiB |
BIN
src/wp-content/plugins/catablog/images/close-lightbox.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
src/wp-content/plugins/catablog/images/drag-handle.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/wp-content/plugins/catablog/images/gray-grad.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
src/wp-content/plugins/catablog/images/progress-background.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/wp-content/plugins/catablog/images/sort.gif
Normal file
|
After Width: | Height: | Size: 54 B |
BIN
src/wp-content/plugins/catablog/images/sortable_handle.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/wp-content/plugins/catablog/images/upload.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
215
src/wp-content/plugins/catablog/js/catablog-admin.js
Normal file
@ -0,0 +1,215 @@
|
||||
function show_load() {
|
||||
jQuery('body').append("<div id='catablog_load_curtain' />");
|
||||
jQuery('#catablog_load_curtain').append("<div id='catablog_load_display'>...</div>");
|
||||
|
||||
jQuery('#catablog_load_curtain').fadeTo(200, 0.8);
|
||||
}
|
||||
function hide_load() {
|
||||
setTimeout(function() {
|
||||
jQuery('#catablog_load_curtain').fadeOut(400, function() {
|
||||
jQuery(this).remove();
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
function show_image_upload_modal() {
|
||||
jQuery('body').append("<div id='catablog_load_curtain' />");
|
||||
jQuery('#catablog_load_curtain').append("<div id='catablog_load_display'>...</div>");
|
||||
|
||||
jQuery('#catablog_load_curtain').fadeTo(200, 0.8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function discourage_leaving_page(message) {
|
||||
var all_links = jQuery('a').filter(function() {
|
||||
return ( jQuery(this).attr('href').charAt(0) != '#' );
|
||||
}).filter(function() {
|
||||
return (jQuery(this).hasClass('cb_disabled_link') == false);
|
||||
});
|
||||
|
||||
all_links.bind('click', function(event) {
|
||||
if (message == null) {
|
||||
message = "you should not leave the page...";
|
||||
}
|
||||
if(!confirm(message)) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function unbind_discourage_leaving_page() {
|
||||
var all_links = jQuery('a').filter(function() {
|
||||
return ( jQuery(this).attr('href').charAt(0) != '#' );
|
||||
});
|
||||
|
||||
all_links.unbind('click');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function is_integer(s) {
|
||||
return (s.toString().search(/^[0-9]+$/) == 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function enable_save_button() {
|
||||
jQuery('#save_changes').attr('disabled', false);
|
||||
jQuery('#save_changes').attr('class', 'button-primary');
|
||||
}
|
||||
|
||||
function disable_save_button() {
|
||||
jQuery('#save_changes').attr('disabled', true);
|
||||
jQuery('#save_changes').attr('class', 'button-disabled');
|
||||
}
|
||||
|
||||
|
||||
|
||||
function possibly_disable_save_button() {
|
||||
if (jQuery('small.error:visible').size() == 0) {
|
||||
jQuery('#save_changes').attr('disabled', false);
|
||||
jQuery('#save_changes').attr('class', 'button-primary');
|
||||
}
|
||||
else {
|
||||
jQuery('#save_changes').attr('disabled', true);
|
||||
jQuery('#save_changes').attr('class', 'button-disabled');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function renderCataBlogItems(images, type, nonce, callback) {
|
||||
total_count = images.length;
|
||||
renderCataBlogItem(images.shift(), type, images, nonce, total_count, callback);
|
||||
}
|
||||
|
||||
function renderCataBlogItem(image, type, a, nonce, total_count, callback) {
|
||||
var progress_bar = jQuery('#catablog-progress-' + type + ' .catablog-progress-bar');
|
||||
var progress_text = jQuery('#catablog-progress-' + type + ' .catablog-progress-text');
|
||||
var percent_complete = 100 - ((a.length / total_count) * 100);
|
||||
|
||||
|
||||
var params = {
|
||||
'image': image,
|
||||
'type': type,
|
||||
'count': a.length,
|
||||
'total': total_count,
|
||||
'action': 'catablog_render_images',
|
||||
'security': nonce
|
||||
}
|
||||
|
||||
jQuery.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
data = eval(data);
|
||||
|
||||
var progress_message = data.message;
|
||||
progress_text.html(percent_complete.toFixed(1)+'% <small>'+progress_message+'</small>');
|
||||
|
||||
if (data.success == false) {
|
||||
jQuery('#catablog-console').append('<li class="error">' + data.error + '</li>')
|
||||
}
|
||||
|
||||
}
|
||||
catch(e) {
|
||||
jQuery('#catablog-console').append('<li class="error">' + e + '</li>')
|
||||
}
|
||||
|
||||
if (a.length > 0) {
|
||||
progress_bar.css('width', percent_complete + '%');
|
||||
renderCataBlogItem(a.shift(), type, a, nonce, total_count, callback);
|
||||
}
|
||||
else {
|
||||
progress_bar.css('width', '100%');
|
||||
progress_text.html(progress_message);
|
||||
// unbind_discourage_leaving_page();
|
||||
callback.call(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
catablog_global_lazyload_elements = null;
|
||||
|
||||
function calculate_lazy_loads() {
|
||||
var scroll_top = jQuery(window).scrollTop();
|
||||
var scroll_bottom = scroll_top + jQuery(window).height() - 20;
|
||||
|
||||
if (catablog_global_lazyload_elements == null) {
|
||||
catablog_global_lazyload_elements = jQuery('#catablog_items a.lazyload');
|
||||
}
|
||||
|
||||
|
||||
catablog_global_lazyload_elements.each(function(i) {
|
||||
var top_offset = jQuery(this).offset().top;
|
||||
|
||||
if (scroll_bottom > top_offset) {
|
||||
jQuery(this).removeClass('lazyload');
|
||||
jQuery(this).append('<img class="cb_item_icon" />');
|
||||
jQuery(this).children('img').hide().attr('src', jQuery(this).attr('rel')).show();
|
||||
|
||||
catablog_global_lazyload_elements = catablog_global_lazyload_elements.not(this);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function replaceSelection (input, replaceString) {
|
||||
if (input.setSelectionRange) {
|
||||
var selectionStart = input.selectionStart;
|
||||
var selectionEnd = input.selectionEnd;
|
||||
input.value = input.value.substring(0, selectionStart)+ replaceString + input.value.substring(selectionEnd);
|
||||
|
||||
if (selectionStart != selectionEnd){
|
||||
setSelectionRange(input, selectionStart, selectionStart + replaceString.length);
|
||||
}else{
|
||||
setSelectionRange(input, selectionStart + replaceString.length, selectionStart + replaceString.length);
|
||||
}
|
||||
|
||||
}else if (document.selection) {
|
||||
var range = document.selection.createRange();
|
||||
|
||||
if (range.parentElement() == input) {
|
||||
var isCollapsed = range.text == '';
|
||||
range.text = replaceString;
|
||||
|
||||
if (!isCollapsed) {
|
||||
range.moveStart('character', -replaceString.length);
|
||||
range.select();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function setSelectionRange(input, selectionStart, selectionEnd) {
|
||||
if (input.setSelectionRange) {
|
||||
input.focus();
|
||||
input.setSelectionRange(selectionStart, selectionEnd);
|
||||
}
|
||||
else if (input.createTextRange) {
|
||||
var range = input.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', selectionEnd);
|
||||
range.moveStart('character', selectionStart);
|
||||
range.select();
|
||||
}
|
||||
}
|
||||
110
src/wp-content/plugins/catablog/js/catablog.handlers.js
Normal file
@ -0,0 +1,110 @@
|
||||
|
||||
function catablog_swfupload_loaded() {
|
||||
|
||||
}
|
||||
|
||||
function catablog_swfupload_file_dialog_complete(numFilesSelected, numFilesQueued, totalFilesQueued) {
|
||||
try {
|
||||
if (numFilesSelected > 0) {
|
||||
|
||||
var total_uploads = this.getStats().successful_uploads + this.getStats().files_queued;
|
||||
|
||||
jQuery('#current_number').html(this.getStats().successful_uploads);
|
||||
jQuery('#total_number').html(total_uploads);
|
||||
jQuery('#upload-form-right-col').removeClass('hide');
|
||||
|
||||
// jQuery('#cancel-upload').attr('disabled', false);
|
||||
|
||||
this.startUpload();
|
||||
}
|
||||
} catch (error) {
|
||||
this.debug(error);
|
||||
}
|
||||
}
|
||||
|
||||
function catablog_swfupload_file_queued(file) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function catablog_swfupload_upload_start(file) {
|
||||
try {
|
||||
var total_uploads = this.getStats().successful_uploads + this.getStats().files_queued;
|
||||
var percent = Math.ceil((this.getStats().successful_uploads / total_uploads) * 100) + '%';
|
||||
|
||||
jQuery('#catablog-progress-all-uploads .catablog-progress-bar').width(percent);
|
||||
jQuery('#catablog-progress-all-uploads .catablog-progress-text').html(percent);
|
||||
|
||||
jQuery('#catablog-progress-current-upload .catablog-progress-bar').width(0);
|
||||
jQuery('#catablog-progress-current-upload .catablog-progress-text').html(file.name);
|
||||
|
||||
jQuery('#current_number').html(this.getStats().successful_uploads + 1);
|
||||
jQuery('#total_number').html(total_uploads);
|
||||
// jQuery('#upload-form-right-col').removeClass('hide');
|
||||
|
||||
|
||||
} catch(error) {
|
||||
this.debug(error);
|
||||
}
|
||||
}
|
||||
|
||||
function catablog_swfupload_upload_progress(file, bytesLoaded, bytesTotal) {
|
||||
var percent = Math.ceil((bytesLoaded/bytesTotal) * 100) + '%';
|
||||
jQuery('#catablog-progress-current-upload .catablog-progress-bar').width(percent);
|
||||
}
|
||||
|
||||
function catablog_swfupload_upload_success(file, serverData) {
|
||||
try {
|
||||
var total_uploads = this.getStats().successful_uploads + this.getStats().files_queued;
|
||||
var percent = Math.ceil((this.getStats().successful_uploads / total_uploads) * 100) + '%';
|
||||
|
||||
jQuery('#catablog-progress-all-uploads .catablog-progress-bar').width(percent);
|
||||
jQuery('#catablog-progress-all-uploads .catablog-progress-text').html(percent);
|
||||
|
||||
jQuery('#catablog-progress-current-upload .catablog-progress-bar').width('100%');
|
||||
|
||||
jQuery('#new-items-editor').append(serverData);
|
||||
jQuery('#new-items-editor li:last input.title').bind('keypress', catablog_micro_save);
|
||||
jQuery('#new-items-editor li:last input.button-primary').bind('click', catablog_micro_save);
|
||||
jQuery('#new-items-editor li:last').show(800);
|
||||
|
||||
} catch(error) {
|
||||
this.debug(error);
|
||||
}
|
||||
}
|
||||
|
||||
function catablog_swfupload_upload_complete(file) {
|
||||
try {
|
||||
var total_uploads = this.getStats().successful_uploads + this.getStats().files_queued;
|
||||
var percent = Math.ceil((this.getStats().successful_uploads / total_uploads) * 100) + '%';
|
||||
|
||||
jQuery('#catablog-progress-all-uploads .catablog-progress-bar').width(percent);
|
||||
jQuery('#catablog-progress-all-uploads .catablog-progress-text').html(percent);
|
||||
|
||||
jQuery('#catablog-progress-current-upload .catablog-progress-bar').width('100%');
|
||||
|
||||
if (this.getStats().files_queued > 0) {
|
||||
this.startUpload();
|
||||
}
|
||||
|
||||
} catch(error) {
|
||||
this.debug(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function catablog_swfupload_file_queued_error(file, error_code, message) {
|
||||
var string = "File Queue Error:\n";
|
||||
// for (p in message) {
|
||||
// string += p + ": " + message[p];
|
||||
// }
|
||||
string += message;
|
||||
alert(string);
|
||||
}
|
||||
|
||||
function catablog_swfupload_upload_error(file, error_code, message) {
|
||||
var string = "Upload Error:\n";
|
||||
string += message;
|
||||
alert(string);
|
||||
}
|
||||
553
src/wp-content/plugins/catablog/js/catablog.lightbox.js
Normal file
@ -0,0 +1,553 @@
|
||||
jQuery(function($) {
|
||||
jQuery.fn.catablogLightbox = function(config) {
|
||||
// PlugIn Variables
|
||||
var size = this.size();
|
||||
var settings = {'size': size};
|
||||
if (config) jQuery.extend(settings, config);
|
||||
|
||||
var timeout = null;
|
||||
|
||||
var image_extensions = ['jpg', 'jpeg', 'gif', 'png'];
|
||||
var hold_click = false;
|
||||
var lightbox_images = [];
|
||||
var current_image = -1;
|
||||
|
||||
// PlugIn Construction applied across each selected jQuery object
|
||||
this.each(function(i) {
|
||||
|
||||
lightbox_images[i] = this;
|
||||
|
||||
if (jQuery(this).get(0).nodeName.toLowerCase() == "a") {
|
||||
// selected element is an achor tag
|
||||
|
||||
var href = jQuery(this).attr('href');
|
||||
var extension = href.split('.').pop().toLowerCase();
|
||||
|
||||
if (in_array(extension, image_extensions)) {
|
||||
|
||||
jQuery(this).bind('click', function(event) {
|
||||
current_image = i;
|
||||
open_lightbox(lightbox_images[i]);
|
||||
|
||||
jQuery('.catablog-selected').removeClass('catablog-selected');
|
||||
jQuery(this).addClass('catablog-selected');
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
else if (jQuery(this).get(0).nodeName.toLowerCase() == "img") {
|
||||
// selected element is an image tag
|
||||
if (typeof(console) !== 'undefined' && console != null) {
|
||||
console.log('You are using the CataBlog LightBox in an incorrect way, please set the lightbox selector to point at anchor tags surrounding your thumbnail images.');
|
||||
}
|
||||
|
||||
jQuery(this).css('cursor','pointer').bind('click', function(event) {
|
||||
current_image = i;
|
||||
open_lightbox(lightbox_images[i]);
|
||||
|
||||
jQuery('.catablog-selected').removeClass('catablog-selected');
|
||||
jQuery(this).addClass('catablog-selected');
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
// selected element is of an unsupported tag type
|
||||
if (typeof(console) !== 'undefined' && console != null) {
|
||||
console.log('You are using the CataBlog LightBox in an incorrect way, please set the lightbox selector to point at anchor tags surrounding your thumbnail images.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Private Functions
|
||||
function open_lightbox(element) {
|
||||
|
||||
var support_fixed = supportPositionFixed();
|
||||
var curtain_density = 0.85;
|
||||
var fadein_speed = 0;
|
||||
var page_top = jQuery(document).scrollTop() + 30;
|
||||
|
||||
// add the curtain div into the DOM
|
||||
jQuery('body').append("<div id='catablog-curtain'> </div>");
|
||||
var curtain = jQuery('#catablog-curtain');
|
||||
|
||||
// bind the curtain click and fade the curtain into view
|
||||
curtain.bind('click', function() {
|
||||
close_lightbox();
|
||||
});
|
||||
curtain.css('opacity', curtain_density);
|
||||
|
||||
if (!support_fixed) {
|
||||
var window_height = jQuery(window).height();
|
||||
var document_height = jQuery(document).height();
|
||||
curtain.css('position', 'absolute');
|
||||
curtain.height(document_height);
|
||||
}
|
||||
|
||||
// if (supportPositionFixed() != true) {
|
||||
// jQuery('#catablog-curtain').height(jQuery(document).height());
|
||||
// }
|
||||
|
||||
|
||||
// add the lightbox div into the DOM
|
||||
jQuery('body').append("<div id='catablog-lightbox'><div id='catablog-whiteboard' class='loading'></div></div>");
|
||||
var lightbox = jQuery('#catablog-lightbox');
|
||||
lightbox.css('top', page_top);
|
||||
|
||||
|
||||
// MAKE NOTE HERE
|
||||
lightbox.bind('click', function() {
|
||||
close_lightbox();
|
||||
});
|
||||
jQuery('#catablog-whiteboard').bind('click', function(event) {
|
||||
event.stopPropagation();
|
||||
// do not return false, break a:links in whiteboard
|
||||
});
|
||||
|
||||
|
||||
lightbox.show();
|
||||
|
||||
load_catablog_image(element);
|
||||
|
||||
|
||||
// // load the full size picture and expand the lightbox to fit the images dimensions
|
||||
// var fullsize_pic = new Image();
|
||||
// fullsize_pic.onload = function() {
|
||||
// var row = jQuery(element).closest('.catablog-row').get(0);
|
||||
// var meta = calculateMeta(row);
|
||||
// expand_lightbox(this, meta);
|
||||
// };
|
||||
// fullsize_pic.onerror = function() {
|
||||
// if (this.src.indexOf("/catablog/originals") < 0) {
|
||||
// this.src = this.src.replace("/catablog/fullsize", "/catablog/originals");;;
|
||||
// }
|
||||
// };
|
||||
//
|
||||
//
|
||||
// if (element.nodeName.toLowerCase() == 'a') {
|
||||
// fullsize_pic.src = element.href;
|
||||
// }
|
||||
// else {
|
||||
// fullsize_pic.src = element.src.replace("/catablog/thumbnails", "/catablog/fullsize");;;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function expand_lightbox(img, meta) {
|
||||
|
||||
var lightbox = jQuery('#catablog-whiteboard');
|
||||
|
||||
var w = img.width;
|
||||
var h = img.height;
|
||||
var s = img.src;
|
||||
|
||||
var window_width = jQuery(window).width();
|
||||
var window_height = jQuery(window).height();
|
||||
|
||||
if (w > window_width || h > window_height) {
|
||||
w_ratio = window_width / w - 0.1;
|
||||
h_ratio = window_height / h - 0.1;
|
||||
|
||||
if (w_ratio < h_ratio) {
|
||||
w = w * w_ratio;
|
||||
h = h * w_ratio;
|
||||
}
|
||||
else {
|
||||
w = w * h_ratio;
|
||||
h = h * h_ratio;
|
||||
}
|
||||
}
|
||||
|
||||
var title = "<h4 class='catablog-lightbox-title'>" + meta.title + "</h4>";
|
||||
var description = "<p class='catablog-lightbox-desc'>" + meta.description + "</p>";
|
||||
var nav = meta.nav;
|
||||
var close = meta.close
|
||||
|
||||
// attach image and navigation
|
||||
jQuery(lightbox).append("<div id='catablog-lightbox-image' />");
|
||||
jQuery('#catablog-lightbox-image').height(h);
|
||||
|
||||
if (!jQuery('#catablog-lightbox-image').append("<img src='"+s+"' />")) {
|
||||
if (typeof(console) !== 'undefined' && console != null) {
|
||||
console.log('failed appending image to html dom');
|
||||
}
|
||||
};
|
||||
|
||||
jQuery('#catablog-lightbox-image img').css({width:w, height:h});
|
||||
|
||||
jQuery('#catablog-lightbox-image').append(nav);
|
||||
jQuery('#catablog-lightbox-image a').height(h);
|
||||
|
||||
// attach meta data below image
|
||||
jQuery(lightbox).append("<div id='catablog-lightbox-meta' />");
|
||||
jQuery('#catablog-lightbox-meta').append(title);
|
||||
jQuery('#catablog-lightbox-meta').append(description);
|
||||
|
||||
jQuery('#catablog-whiteboard').append(close);
|
||||
|
||||
|
||||
lightbox.animate({width:w, height:h}, 400, function() {
|
||||
|
||||
jQuery('#catablog-whiteboard').removeClass('loading');
|
||||
|
||||
var full_height = h + jQuery('#catablog-lightbox-meta').outerHeight();
|
||||
|
||||
jQuery(this).children('#catablog-lightbox-meta').show();
|
||||
jQuery(this).animate({height:full_height}, 400, function() {
|
||||
hold_click = false;
|
||||
bindNavigationControls();
|
||||
})
|
||||
|
||||
jQuery('#catablog-lightbox-image').fadeIn(400, function() {
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function change_lightbox(element) {
|
||||
|
||||
jQuery('#catablog-whiteboard').addClass('loading');
|
||||
|
||||
var row = jQuery(element).closest('.catablog-row').get(0);
|
||||
var speed = 150;
|
||||
|
||||
jQuery('#catablog-lightbox-meta').fadeOut(speed, function() {
|
||||
jQuery(this).remove();
|
||||
});
|
||||
jQuery('#catablog-lightbox-image').fadeOut(speed, function() {
|
||||
jQuery(this).remove();
|
||||
|
||||
|
||||
load_catablog_image(element);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function load_catablog_image(element) {
|
||||
var load_attempts = 0;
|
||||
|
||||
var fullsize_pic = new Image();
|
||||
fullsize_pic.onload = function() {
|
||||
var row = jQuery(element).closest('.catablog-row').get(0);
|
||||
var meta = calculateMeta(row);
|
||||
expand_lightbox(this, meta);
|
||||
};
|
||||
fullsize_pic.onerror = function() {
|
||||
load_attempts++;
|
||||
if (load_attempts < 2) {
|
||||
this.src = this.src.replace("/catablog/fullsize", "/catablog/originals");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if (element.nodeName.toLowerCase() == 'a') {
|
||||
fullsize_pic.src = element.href;
|
||||
}
|
||||
else {
|
||||
fullsize_pic.src = element.src.replace("/catablog/thumbnails", "/catablog/fullsize");;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function navigate_lightbox(direction) {
|
||||
if (hold_click) {
|
||||
return false;
|
||||
}
|
||||
|
||||
hold_click = true;
|
||||
unbindNavigationControls();
|
||||
|
||||
var selected = jQuery('.catablog-selected');
|
||||
var new_image = null;
|
||||
|
||||
if (direction == 'next') {
|
||||
new_image = lightbox_images[current_image + 1];
|
||||
if (new_image == undefined) {
|
||||
current_image = 0;
|
||||
new_image = lightbox_images[current_image];
|
||||
}
|
||||
current_image += 1;
|
||||
}
|
||||
else if (direction == 'prev') {
|
||||
new_image = lightbox_images[current_image - 1];
|
||||
if (new_image == undefined) {
|
||||
current_image = lightbox_images.length - 1;
|
||||
new_image = lightbox_images[current_image];
|
||||
}
|
||||
current_image -= 1;
|
||||
}
|
||||
|
||||
|
||||
// check if the new_image is an a tag or its wrapped in an a tag
|
||||
// if wrapped in an anchor tag, replace new_image with the anchor tag
|
||||
// if not wrapped in an achor tag, log an error to the console if it exists
|
||||
if (new_image.nodeName.toLowerCase() != 'a') {
|
||||
if (jQuery(new_image).closest('a').size() > 0) {
|
||||
new_image = jQuery(new_image).closest('a').get(0);
|
||||
} else {
|
||||
if (new_image.nodeName.toLowerCase() == 'img') {
|
||||
|
||||
}
|
||||
else {
|
||||
if (typeof(console) !== 'undefined' && console != null) {
|
||||
console.log("Could not find the adjacent image because the adjacent .catablog-image element is not an anchor or image tag.");
|
||||
}
|
||||
|
||||
hold_click = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var new_href = '';
|
||||
if (new_image.nodeName.toLowerCase() == 'a') {
|
||||
var new_href = new_image.href;
|
||||
}
|
||||
else {
|
||||
var new_href = new_image.src;
|
||||
}
|
||||
|
||||
|
||||
var new_extension = new_href.split('.').pop().toLowerCase();
|
||||
if (in_array(new_extension, image_extensions) == false) {
|
||||
if (current_image == 0) {
|
||||
hold_click = false;
|
||||
navigate_lightbox('next');
|
||||
}
|
||||
else if (current_image == (lightbox_images.length - 1)) {
|
||||
hold_click = false;
|
||||
navigate_lightbox('prev');
|
||||
}
|
||||
else {
|
||||
hold_click = false;
|
||||
navigate_lightbox(direction);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
new_thumbnail = new_image;
|
||||
|
||||
|
||||
|
||||
selected.removeClass('catablog-selected');
|
||||
jQuery(new_image).addClass('catablog-selected');
|
||||
|
||||
change_lightbox(new_thumbnail);
|
||||
}
|
||||
|
||||
|
||||
function close_lightbox() {
|
||||
unbindNavigationControls();
|
||||
|
||||
var fadeout_speed = 300;
|
||||
|
||||
jQuery('#catablog-curtain').fadeOut(fadeout_speed, function() {
|
||||
jQuery(this).remove();
|
||||
});
|
||||
jQuery('#catablog-lightbox').fadeOut(fadeout_speed, function() {
|
||||
jQuery(this).remove();
|
||||
});
|
||||
jQuery('.catablog-selected').removeClass('catablog-selected');
|
||||
}
|
||||
|
||||
|
||||
|
||||
function calculateMeta(row) {
|
||||
var row = jQuery(row);
|
||||
|
||||
if ((typeof js_i18n) == 'undefined') {
|
||||
var prev_tip = 'You may also press "P" or the left arrow on your keyboard';
|
||||
var next_tip = 'You may also press "N" or the right arrow on your keyboard';
|
||||
var close_tip = "Close LightBox Now";
|
||||
//
|
||||
var prev_label = "PREV";
|
||||
var next_label = "NEXT";
|
||||
var close_label = "CLOSE";
|
||||
}
|
||||
else {
|
||||
var prev_tip = ((typeof js_i18n.prev_tip) == 'undefined')? 'You may also press "P" or the left arrow on your keyboard' : js_i18n.prev_tip;
|
||||
var next_tip = ((typeof js_i18n.prev_tip) == 'undefined')? 'You may also press "N" or the right arrow on your keyboard' : js_i18n.next_tip;
|
||||
var close_tip = ((typeof js_i18n.prev_tip) == 'undefined')? 'Close LightBox Now' : js_i18n.close_tip;
|
||||
//
|
||||
var prev_label = ((typeof js_i18n.prev_tip) == 'undefined')? "PREV" : js_i18n.prev_label;
|
||||
var next_label = ((typeof js_i18n.prev_tip) == 'undefined')? "NEXT" : js_i18n.next_label;
|
||||
var close_label = ((typeof js_i18n.prev_tip) == 'undefined')? "CLOSE" : js_i18n.close_label;
|
||||
}
|
||||
|
||||
var prev_button = "<a href='#prev' id='catablog-lightbox-prev' class='catablog-nav' title='"+prev_tip+"'><span class='catablog-lightbox-nav-label'>"+prev_label+"</span></a>";
|
||||
var next_button = "<a href='#next' id='catablog-lightbox-next' class='catablog-nav' title='"+next_tip+"'><span class='catablog-lightbox-nav-label'>"+next_label+"</span></a>";
|
||||
var close_button = "<a href='#close' id='catablog-lightbox-close' class='catablog-nav' title='"+close_tip+"'>"+close_label+"</a>";
|
||||
|
||||
var meta = {};
|
||||
|
||||
var title = row.find('.catablog-title').html()
|
||||
var description = row.find('.catablog-description').html();
|
||||
|
||||
meta.title = (title == null)? "" : title;
|
||||
meta.description = (description == null)? "" : description;
|
||||
meta.buynow = "";
|
||||
meta.close = close_button;
|
||||
|
||||
meta.nav = "";
|
||||
|
||||
if (current_image < (lightbox_images.length - 1)) {
|
||||
meta.nav += next_button;
|
||||
}
|
||||
if (current_image > 0) {
|
||||
meta.nav += prev_button;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************
|
||||
** SUPPORT METHODS
|
||||
******************************/
|
||||
function supportPositionFixed() {
|
||||
var isSupported = null;
|
||||
if (document.createElement) {
|
||||
var el = document.createElement('div');
|
||||
if (el && el.style) {
|
||||
el.style.position = 'fixed';
|
||||
el.style.top = '10px';
|
||||
var root = document.body;
|
||||
if (root && root.appendChild && root.removeChild) {
|
||||
root.appendChild(el);
|
||||
isSupported = (el.offsetTop === 10);
|
||||
root.removeChild(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
return isSupported;
|
||||
}
|
||||
|
||||
function bindNavigationControls() {
|
||||
|
||||
// bind next and previous buttons
|
||||
jQuery('#catablog-lightbox-prev').bind('click', function(event) {
|
||||
navigate_lightbox('prev');
|
||||
return false;
|
||||
});
|
||||
|
||||
jQuery('#catablog-lightbox-next').bind('click', function(event) {
|
||||
navigate_lightbox('next');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// bind close button
|
||||
jQuery('#catablog-lightbox-close').bind('click', function(event) {
|
||||
close_lightbox();
|
||||
return false;
|
||||
});
|
||||
jQuery('#catablog-lightbox-close').bind('mouseenter', function(event) {
|
||||
jQuery(this).addClass('catablog-lightbox-close-hover');
|
||||
return false;
|
||||
});
|
||||
jQuery('#catablog-lightbox-close').bind('mouseleave', function(event) {
|
||||
jQuery(this).removeClass('catablog-lightbox-close-hover');
|
||||
return false;
|
||||
});
|
||||
jQuery(document).bind('mousemove', function(event) {
|
||||
var close_button = jQuery('#catablog-lightbox-close');
|
||||
|
||||
if (close_button.is(':hidden')) {
|
||||
close_button.css('zIndex', 10800);
|
||||
close_button.fadeIn(50);
|
||||
}
|
||||
else {
|
||||
hideCloseButtonTimer(close_button);
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
// bind keyboard shortcuts
|
||||
jQuery(document).bind('keyup', function(event) {
|
||||
var key_code = (event.keyCode ? event.keyCode : event.which);
|
||||
|
||||
var forward_keycodes = [39, 78, 83];
|
||||
var back_keycodes = [37, 80, 65];
|
||||
var escape_keycodes = [27];
|
||||
|
||||
if (in_array(key_code, forward_keycodes)) {
|
||||
jQuery('#catablog-lightbox-next').click();
|
||||
}
|
||||
if (in_array(key_code, back_keycodes)) {
|
||||
jQuery('#catablog-lightbox-prev').click();
|
||||
}
|
||||
if (in_array(key_code, escape_keycodes)) {
|
||||
close_lightbox();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function unbindNavigationControls() {
|
||||
jQuery('#catablog-lightbox-prev').unbind('click');
|
||||
jQuery('#catablog-lightbox-next').unbind('click');
|
||||
jQuery('#catablog-lightbox-close').unbind('click');
|
||||
jQuery(document).unbind('mousemove');
|
||||
jQuery(document).unbind('keyup');
|
||||
|
||||
jQuery('#catablog-lightbox-close').fadeOut(200);
|
||||
}
|
||||
|
||||
function hideCloseButtonTimer(obj) {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(function() {
|
||||
if (obj.hasClass('catablog-lightbox-close-hover')) {
|
||||
hideCloseButtonTimer(obj);
|
||||
}
|
||||
else {
|
||||
obj.fadeOut(200);
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
function in_array (needle, haystack, argStrict) {
|
||||
var key = '', strict = !!argStrict;
|
||||
|
||||
if (strict) {
|
||||
for (key in haystack) {
|
||||
if (haystack[key] === needle) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (key in haystack) {
|
||||
if (haystack[key] == needle) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
2640
src/wp-content/plugins/catablog/lib/CataBlog.class.php
Normal file
119
src/wp-content/plugins/catablog/lib/CataBlogDirectory.class.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
class CataBlogDirectory {
|
||||
private $filearray = array();
|
||||
private $directory = "";
|
||||
|
||||
|
||||
public function __construct($directory) {
|
||||
$this->directory = $directory;
|
||||
$d = "";
|
||||
if (is_dir($directory)) {
|
||||
$d = opendir($directory) or exit(__("Could not open directory.", 'catablog'));
|
||||
while (false !== ($f=readdir($d))) {
|
||||
if (is_file("$directory/$f")) {
|
||||
if (substr($f, 0, 1) != '.') {
|
||||
$this->filearray[] = $f;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($d);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function isDirectory() {
|
||||
return is_dir($this->directory);
|
||||
}
|
||||
|
||||
public function getFileArray() {
|
||||
return $this->filearray;
|
||||
}
|
||||
|
||||
public function indexOrder() {
|
||||
sort($this->filearray);
|
||||
}
|
||||
|
||||
public function naturalCaseInsensitiveOrder() {
|
||||
natcasesort($this->filearray);
|
||||
}
|
||||
|
||||
public function getCount() {
|
||||
return count($this->filearray);
|
||||
}
|
||||
|
||||
public function getDirectorySize() {
|
||||
$filesize = 0;
|
||||
foreach ($this->filearray as $file) {
|
||||
$filesize = $filesize + filesize($this->directory . "/$file");
|
||||
}
|
||||
|
||||
return $filesize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function checkAllImages() {
|
||||
$bln = true;
|
||||
$extension = "";
|
||||
$types = array("jpg", "jpeg", "gif", "png");
|
||||
foreach ($this->filearray as $key => $value) {
|
||||
$extension = substr($value, (strrpos($value, ".") + 1));
|
||||
$extension = strtolower($extension);
|
||||
if (!in_array($extension, $types)) {
|
||||
$bln = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $bln;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function checkAllSpecificType($extension) {
|
||||
$extension = strtolower($extension);
|
||||
$bln = true;
|
||||
$ext = "";
|
||||
foreach ($this->filearray as $key => $value) {
|
||||
$ext = substr($value, (strrpos($value, ".") + 1));
|
||||
$ext = strtolower($ext);
|
||||
if ($extension != $ext) {
|
||||
$bln = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $bln;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function filter($extension) {
|
||||
$extension = strtolower($extension);
|
||||
foreach ($this->filearray as $key => $value) {
|
||||
$ext = substr($value, (strrpos($value, ".") + 1));
|
||||
$ext = strtolower($ext);
|
||||
if ($ext != $extension) {
|
||||
unset($this->filearray[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function removeFilter() {
|
||||
unset($this->filearray);
|
||||
$d = "";
|
||||
$d = opendir($this->directory) or exit(__("Could not open directory.", 'catablog'));
|
||||
while (false !== ($f = readdir($d))) {
|
||||
if (is_file("$this->directory/$f")) {
|
||||
$this->filearray[] = $f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
1018
src/wp-content/plugins/catablog/lib/CataBlogItem.class.php
Normal file
112
src/wp-content/plugins/catablog/lib/catablog.upload.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* CataBlog Media Upload script
|
||||
*
|
||||
* @package CataBlog
|
||||
* @author Zachary Segal
|
||||
*/
|
||||
|
||||
/**
|
||||
* This variable is an override for the absolute path
|
||||
* to your WordPress directory on your server. If someone
|
||||
* has customized the location of wp-content, please make
|
||||
* sure to set this variable accordingly
|
||||
*
|
||||
* example: '/var/www/wordpress/';
|
||||
*/
|
||||
$WP_ABS_PATH = '/var/www/wordpress';
|
||||
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
define('WP_ADMIN', true);
|
||||
if ( !defined('WP_LOAD_PATH') ) {
|
||||
/** standard path for wordpress base folder */
|
||||
$default = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/' ;
|
||||
|
||||
if (file_exists( $default . 'wp-load.php') )
|
||||
define( 'WP_LOAD_PATH', $default);
|
||||
else
|
||||
if (file_exists( $WP_ABS_PATH . 'wp-load.php') )
|
||||
define( 'WP_LOAD_PATH', $WP_ABS_PATH);
|
||||
else
|
||||
die("<li class='error'>Cannot locate wp-load.php. Please read more at <a href='http://catablog.illproductions.com' target='_blank'>catablog.illproductions.com</a></li>");
|
||||
}
|
||||
|
||||
// let's load WordPress
|
||||
require_once( WP_LOAD_PATH . 'wp-load.php');
|
||||
|
||||
// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
|
||||
if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
|
||||
$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
|
||||
$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
|
||||
$_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
|
||||
|
||||
|
||||
unset($current_user);
|
||||
|
||||
|
||||
require_once( ABSPATH . '/wp-admin/admin.php');
|
||||
|
||||
|
||||
header('Content-Type: text/plain; charset='.get_option('blog_charset'));
|
||||
|
||||
|
||||
if (!is_user_logged_in()) {
|
||||
die("<li class='error'>".__('Login failure. You must be logged into the WordPress Admin section.', 'catablog')."</li>");
|
||||
}
|
||||
|
||||
if ( !current_user_can('edit_posts')) {
|
||||
die("<li class='error'>".__('Your Admin account does not have permission to "edit_posts".', 'catablog')."</li>");
|
||||
}
|
||||
|
||||
check_admin_referer('catablog_swfupload');
|
||||
|
||||
global $wp_plugin_catablog_class;
|
||||
|
||||
$tmp_name = $_FILES['Filedata']['tmp_name'];
|
||||
$_FILES['new_image'] = $_FILES['Filedata'];
|
||||
if (strlen($tmp_name) < 1) {
|
||||
die("<li class='error'>".__('Image could not be uploaded to the server, please try again.', 'catablog')."</li>");
|
||||
}
|
||||
|
||||
$new_item = new CataBlogItem();
|
||||
$valid_image = $new_item->validateImage($tmp_name);
|
||||
if ($valid_image === true) {
|
||||
$new_item_title = $_FILES['Filedata']['name'];
|
||||
$new_item_title = preg_replace('/\.[^.]+$/','',$new_item_title);
|
||||
$new_item_title = str_replace(array('_','-','.'), ' ', $new_item_title);
|
||||
$new_item_order = wp_count_posts($new_item->custom_post_name)->publish + 1;
|
||||
|
||||
$new_item->setOrder($new_item_order);
|
||||
$new_item->setTitle($new_item_title);
|
||||
|
||||
$new_item->setImage($tmp_name);
|
||||
$new_item->setSubImages(array());
|
||||
|
||||
$default_term = $wp_plugin_catablog_class->get_default_term();
|
||||
$new_item->setCategories(array($default_term->term_id=>$default_term->name));
|
||||
|
||||
$new_item->save();
|
||||
|
||||
$html = "<li>";
|
||||
|
||||
$html .= "<div class='button-elements'>";
|
||||
$html .= "<img src='".$wp_plugin_catablog_class->urls['thumbnails'] . '/' . $new_item->getImage()."' />";
|
||||
$html .= "</div>";
|
||||
|
||||
$html .= "<div class='text-elements'>";
|
||||
$html .= "<input type='text' name='title' class='title' value='".$new_item->getTitle()."' />";
|
||||
$html .= "<input type='hidden' name='id' class='id' value='".$new_item->getId()."' />";
|
||||
$html .= "<textarea name='description' class='description'>".$new_item->getDescription()."</textarea>";
|
||||
$html .= "<input type='button' class='button-primary' name='submit' value='".__('Save Changes', 'catablog')."' />";
|
||||
$html .= "</div>";
|
||||
|
||||
$html .= "</li>";
|
||||
|
||||
die($html);
|
||||
}
|
||||
else {
|
||||
die("<li class='error'>".$valid_image."</li>");
|
||||
}
|
||||
339
src/wp-content/plugins/catablog/license.txt
Normal file
@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
BIN
src/wp-content/plugins/catablog/localization/catablog-de_DE.mo
Normal file
1644
src/wp-content/plugins/catablog/localization/catablog-de_DE.po
Normal file
BIN
src/wp-content/plugins/catablog/localization/catablog-es_ES.mo
Normal file
1703
src/wp-content/plugins/catablog/localization/catablog-es_ES.po
Normal file
BIN
src/wp-content/plugins/catablog/localization/catablog-sv_SE.mo
Normal file
1673
src/wp-content/plugins/catablog/localization/catablog-sv_SE.po
Normal file
BIN
src/wp-content/plugins/catablog/localization/catablog.mo
Normal file
1614
src/wp-content/plugins/catablog/localization/catablog.po
Normal file
17
src/wp-content/plugins/catablog/localization/readme.txt
Normal file
@ -0,0 +1,17 @@
|
||||
This file contains instructions and information for people who want to translate CataBlog into another local.
|
||||
|
||||
Please read this page to learn how to translate a file
|
||||
http://codex.wordpress.org/Translating_WordPress
|
||||
|
||||
The included catablog.po file should be duplicated and renamed with the appropriate localization suffix.
|
||||
|
||||
When you are done, please email me the translated PO and MO files.
|
||||
|
||||
Please feel free to contact me with questions or send me your translation files, so I may integrate it into the next version of CataBlog.
|
||||
http://www.illproductions.com/contact/
|
||||
|
||||
|
||||
|
||||
Thanks for your support,
|
||||
|
||||
macguru2000
|
||||
294
src/wp-content/plugins/catablog/readme.txt
Normal file
@ -0,0 +1,294 @@
|
||||
=== CataBlog ===
|
||||
Contributors: macguru2000
|
||||
Donate link: http://catablog.illproductions.com/donate/
|
||||
Tags: plugin, admin, image, images, posts, Post, links, catalog, gallery, portfolio, product catalog, discography, library, collection, store, organize, media, photo, thumbnail, product, listing, list, BuddyPress, ecommerce, Spanish, German, Swedish
|
||||
Requires at least: 3.1
|
||||
Tested up to: 3.2
|
||||
Stable tag: 1.2.9.7
|
||||
|
||||
CataBlog is a comprehensive and effortless tool that allows you to create catalogs, stores and galleries for your blog.
|
||||
|
||||
== Description ==
|
||||
|
||||
CataBlog allows you to catalog pretty much anything you would want and share it through your blog in a simple but elegant gallery. Upload images, give them titles, links, descriptions and then save them into your catalog. Use categories to organize and filter your catalog items into multiple different catalogs. Show off your photos in high resolution with the LightBox effect, perfect for simple galleries. Easy, intuitive and smart design makes it trivial to keep track of all your different catalogs and create amazing e-stores, galleries, lists and more.
|
||||
|
||||
PLEASE DO NOT EMAIL ME DIRECTLY
|
||||
|
||||
Instead post your questions and comments on the appropriate forums. If you have a technical support question, please [write a new topic](http://wordpress.org/tags/catablog?forum_id=10#postform "Create new support thread for CataBlog") on the wordpress.org forums. If you want to join the discussion and suggest new features or development paths, feel free to comment on relevant posts at the [blog](http://catablog.illproductions.com/ "catablog.illproductions.com"). You may also contribute to the community on the [facebook page](http://www.facebook.com/pages/CataBlog/183454038341567 "CataBlog Facebook Page").
|
||||
|
||||
Highlighted Features:
|
||||
|
||||
* Generate individual and category pages for your entire catalog.
|
||||
* Filter by multiple categories with one ShortCode.
|
||||
* Localized for Spanish, Swedish and German.
|
||||
* Sort your catalog by order, title, date or randomly.
|
||||
* Add multiple images to a catalog item.
|
||||
* Control exactly how your catalog HTML code is rendered.
|
||||
* Import and Export your catalog in XML and CSV formats.
|
||||
* Compatible with WordPress MultiSite and Network Activation.
|
||||
* Upload images with FTP and automatically import new files into the catalog.
|
||||
* The Options Page is well organized and supports many configurable settings.
|
||||
* Easy management of your catalog with superiorly designed admin controls.
|
||||
|
||||
Please remember that CataBlog is written, maintained, supported and documented by Zachary Segal. CataBlog is free software, and as such comes with absolutely no warranty or guarantee of service. Please feel free to visit http://catablog.illproductions.com and http://www.illproductions.com for more information about CataBlog and Zachary anytime.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Make sure your server is running `PHP 5` or better and has the `GD` extension.
|
||||
1. Upload `catablog` to the `/wp-content/plugins/` directory.
|
||||
1. Activate the plugin through the `Plugins` menu in WordPress.
|
||||
1. If you want you may also network activate CataBlog.
|
||||
1. Create catalog items by uploading image files.
|
||||
1. Sprinkle the `[catablog]` [Shortcode](http://codex.wordpress.org/Shortcode_API "The Shortcode API") throughout your blog to show your catalog.
|
||||
1. You may also use the template tag, which operates similarly to the Shortcode: `<?php catablog_show_items($cat, $template, $sort, $order, $operator); ?>`
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= Where is the documentation =
|
||||
|
||||
[Click Here](http://catablog.illproductions.com/documentation/introduction-and-installation/ "CataBlog Documentation") for the official documentation.
|
||||
|
||||
= Something is broken, how can I get help =
|
||||
|
||||
1. Read all the documentation at the [official blog](http://catablog.illproductions.com/ "catablog.illproductions.com"), this does get updated so check back frequently.
|
||||
1. [Create a new thread](http://wordpress.org/tags/catablog?forum_id=10#postform "Create new support thread for CataBlog") on the wordpress.org forums and make sure to tag it with catablog.
|
||||
1. Search the [official blog](http://catablog.illproductions.com/ "catablog.illproductions.com") for a post that is relevant to your question and write a comment with your question.
|
||||
|
||||
= What browsers do you support =
|
||||
|
||||
The CataBlog Admin section is made and tested to work best with these browsers:
|
||||
|
||||
1. Internet Explorer 9
|
||||
1. FireFox 4
|
||||
1. Safari 5
|
||||
1. Chrome 11
|
||||
1. JavaScript should be enabled for full support.
|
||||
|
||||
The CataBlog LightBox and Templates are tested to work in these browsers:
|
||||
|
||||
1. Internet Explorer 6, 7, 8 and 9
|
||||
1. Firefox 2, 3 and 4
|
||||
1. Safari and Chrome
|
||||
1. JavaScript must be enabled for LightBox support.
|
||||
|
||||
= I installed CataBlog, now where is it? =
|
||||
|
||||
Look for CataBlog in your WordPress Admin Menu on the bottom, underneath the Settings section.
|
||||
|
||||
= How do I add a new item to my catalog? =
|
||||
|
||||
Login to the Admin Panel of your WordPress blog and go to the CataBlog section by clicking its icon below the Settings section. Now you can click "Add New" next to the page title or in the CataBlog menu itself.
|
||||
|
||||
= How do I customize my catalog's layout? =
|
||||
|
||||
You can easily override CataBlog's CSS classes to create your own design and easily incorporate CataBlog into your site's layout. The recommended way to do this would be to create a catablog.css style file in your theme's directory and add your CSS override code in there. Read more about it at http://catablog.illproductions.com/documentation/displaying-your-catalog-in-posts/.
|
||||
|
||||
= Where can I learn more about CataBlog? =
|
||||
|
||||
Go to http://catablog.illproductions.com, it is a place to learn and share more about your experiences with CataBlog.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Use the list view for a bird's eye of the entire catalog.
|
||||
2. Use the grid view for bigger thumbnails and easier sorting.
|
||||
3. Easy and familiar forms for making and editing catalog items.
|
||||
4. Turn your catalog into a photo gallery using custom templates.
|
||||
5. Display your catalog photos in high resolution with the LightBox.
|
||||
6. CataBlog is now localized for Español.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.2.9.7 =
|
||||
* Fix: Multiple file uploads should not give 404 errors with certain WordPress setups.
|
||||
* Fix: Only loads the flash upload javascript libraries when needed.
|
||||
|
||||
= 1.2.9.6 =
|
||||
* Fix: Better error reporting for flash upload.
|
||||
|
||||
= 1.2.9.5 =
|
||||
* New: Upload multiple files (JavaScript and Flash required).
|
||||
* Fix: %PERMALINK% token now works.
|
||||
|
||||
= 1.2.9.2 =
|
||||
* Fix: Swedish localization updated.
|
||||
|
||||
= 1.2.9.1 =
|
||||
* Fix: Individual and CataBlog category pages now apply WordPress filters on the description if enabled.
|
||||
* Fix: CataBlog Option tabs have been enlarged for German language.
|
||||
* Fix: German localization updated.
|
||||
|
||||
= 1.2.9 =
|
||||
* New: Public Catalog Items: create individual and category pages for your entire catalog.
|
||||
* New: Screen Options for the Library page give users control over pagination and visible data.
|
||||
* New: Add CataBlog menu to the WordPress Admin Bar.
|
||||
* New: Preliminary contextual help added through out the plugins Admin panels.
|
||||
* New: New template function to get a single catalog item by id, catablog_get_item($id).
|
||||
* New: German localization.
|
||||
* Fix: Setting or not setting the category parameter in the Shortcode should behave as expected.
|
||||
* Fix: %TITLE-LINK% token now includes the title target and relationship settings.
|
||||
* Fix: %LINK-TARGET% and %LINK-REL% tokens work once again.
|
||||
* Fix: Image uploads no longer append a timestamp to the file name.
|
||||
* Fix: Your theme's catablog.css file is once again automatically loaded.
|
||||
* Fix: CataBlog class should no longer load if PHP is not at least version 5.
|
||||
|
||||
= 1.2.8 =
|
||||
* Fix: Category filter is better checked before being attached to the catalog query.
|
||||
* New: CataBlog Admin Library limits results to 20 catalog items at a time with pagination.
|
||||
* New: %CATEGORY% token added for listing which categories a catalog item is in.
|
||||
* New: %CATEGORY-SLUGS% token added to be used as category specific CSS classes.
|
||||
* Fix: %DATE% token is now rendered in the blogs set date format.
|
||||
* New: %TIME% token added for displaying the current catalog item's creation time.
|
||||
* Fix: Minor UI tweaks, enhancements and localization file updated with new strings.
|
||||
* New: Works with WordPress 3.2 beta 1.
|
||||
|
||||
= 1.2.7.1 =
|
||||
* New: Swedish localization added
|
||||
|
||||
= 1.2.7 =
|
||||
* New: Bulk Edit Item Categories.
|
||||
* New: The PHP MultiByte String Library is no longer necessary to run CataBlog, but still recommended.
|
||||
* New: Replace reset action with remove, allowing for an easy way to uninstall CataBlog.
|
||||
* Fix: All Admin actions that edit your catalog now check for a security nonce.
|
||||
* Fix: CSV Export no longer adds an extra header for the nonexistent id column.
|
||||
* Fix: %MAIN-IMAGE% token will always be linked to its larger size image if the LightBox is enabled.
|
||||
* Fix: %TITLE-LINK% token is now replaced correctly and in used in the default template.
|
||||
* Fix: Refactored activation, installation and upgrade methods.
|
||||
* Fix: LightBox console does not interfere with Internet Explorer browser.
|
||||
* Fix: LightBox will attempt to load the original upload if the rendered image request returns not found.
|
||||
* Fix: jQuery selector for the LightBox reverts to .catablog-image if empty.
|
||||
* Fix: Incrementally better JavaScript performance in the Admin Panels.
|
||||
|
||||
= 1.2.6 =
|
||||
* Fix: All plugin URLs will now be secure connections if the main page is securely loaded.
|
||||
* Fix: Removed die() function from plugin completely, so changing your server configurations won't break your entire site in some fringe cases.
|
||||
* Fix: Refactored the plugin activation function so it is more reliable.
|
||||
* New: Plugin version number is now saved in your database to help the plugin update itself.
|
||||
|
||||
= 1.2.5.3 =
|
||||
* Fix: Moved the PHP 5 requirement check out of the CataBlog class, allowing proper checking.
|
||||
* Fix: Removed a deprecated token from the built in gallery template.
|
||||
* Fix: Removed the catablog.pot file and instead will include a catablog.po file to be duplicated and translated.
|
||||
* New: The entire CataBlog collection is now labeled 'Library' in the admin menu.
|
||||
* New: Modified the installation instructions to include the server requirements.
|
||||
|
||||
= 1.2.5.2 =
|
||||
* Fix: Fixed display of gallery template, especially in themes that have a #content element.
|
||||
* Fix: CSS tweaks, still trying to make this as compatible as possible.
|
||||
|
||||
= 1.2.5.1 =
|
||||
* Fix: Thumbnail in the edit catalog item form is now resized properly.
|
||||
* Fix: Added a missing CSS class for img.catablog-image
|
||||
* Fix: Fixed the CSS classes for sub images in the default template.
|
||||
* Fix: The inline Stylesheet classes now have #content to help CSS overrides in certain themes.
|
||||
* Fix: The LightBox check if the file extension is an image is no longer case sensitive.
|
||||
* Fix: Secondary images now link to the proper full size images.
|
||||
* Fix: The function for theme developers now has the new shortcode parameters.
|
||||
|
||||
= 1.2.5 =
|
||||
* Important: Requires WordPress 3.1 or better.
|
||||
* Important: Removed drag and drop reordering and exposed the order value for each catalog item.
|
||||
* New: CataBlog ShortCode now supports multiple categories separated by commas.
|
||||
* New: CataBlog ShortCode has a new operator parameter for querying categories.
|
||||
* New: Sort your catalog by order, date, title or randomly.
|
||||
* New: CataBlog ShortCode has sorting parameters.
|
||||
* New: CataBlog ShortCode has a template parameter for overriding the system template.
|
||||
* New: All messages and language may now be localized with included POT file.
|
||||
* New: Preliminary Spanish localization included.
|
||||
* New: Added Date field to the edit catalog item form.
|
||||
* Fix: Removed restrictions on foreign characters for the category name.
|
||||
* Fix: If image_rotate() is not an available function then CataBlog will not use it.
|
||||
* Fix: Thumbnail backgrounds are now filled with a rectangle for better system compatibility.
|
||||
* Fix: The Admin menu position of CataBlog no longer will conflict with certain setups.
|
||||
* Fix: Removed all !important declarations from the catablog.css file.
|
||||
* Fix: Optimized the templates for better theme compatibility.
|
||||
* Fix: Optimized the edit catalog item form for multiple languages.
|
||||
* Fix: When the link field is empty the %LINK% token will now return the full size image instead of #empty-link.
|
||||
* Fix: LightBox is now designed to work best with anchor tags instead of image tags.
|
||||
* Fix: You may now enable the LightBox library and the full size image rendering separately.
|
||||
* Fix: You may change the jQuery selector used to find the LightBox images.
|
||||
* Fix: Optimized front end CSS, instead of inline styles a stylesheet is generated in your pages head tag.
|
||||
|
||||
= 1.2 =
|
||||
* New: Upload multiple images per catalog item now.
|
||||
* New: Template HTML code uses a new catablog-images-column class to group images.
|
||||
* New: Next and previous catalog item links in the edit panel.
|
||||
* Fix: Import and export work better and give more feedback.
|
||||
* Fix: When deleting items your catalog order is now re-indexed properly.
|
||||
* Fix: CSS classes for front end are more verbose and flexible.
|
||||
* Fix: ShortCode Category attribute is not case sensitive.
|
||||
* Fix: Change order button is disabled when viewing a specific category because it didn't work.
|
||||
* Fix: New 'Uncategorized' default category for all new items.
|
||||
|
||||
= 1.1.9 =
|
||||
* Fix: Import no longer makes a sub image when the subimages field is empty.
|
||||
* Fix: Category filter now finds the category slug for the passed in category name.
|
||||
* Fix: New categories made by import or manually will all have a common prefix in their slug.
|
||||
* Fix: Clear database when importing should always delete all catalog items now.
|
||||
|
||||
= 1.1.8 =
|
||||
* Fix: Lots and lots of testing, hopefully everything is a little more stable.
|
||||
* Fix: Database query reduction and optimization across application.
|
||||
* Fix: Categories are now consistently set throughout entire plugin.
|
||||
* Fix: Category slugs should now be completely unique, preventing taxonomy conflicts.
|
||||
* Fix: Code cleaned up and removed old database upgrade methods.
|
||||
* Fix: Various user interface enhancements and bug fixes.
|
||||
|
||||
= 1.1.7 =
|
||||
* Fix: Single site versions of WordPress may now upload sub images.
|
||||
* Fix: Reduced database load on frontend rendering.
|
||||
|
||||
= 1.1.6 =
|
||||
* Fix: Better multiple image per catalog item support.
|
||||
* Fix: catablog-image CSS class reverted to stop upgrade bugs.
|
||||
* Fix: Default template reverted to stop upgrade bugs and new subimages template added.
|
||||
* Fix: Optimized next and previous item links in edit panel.
|
||||
* Fix: Long item descriptions are truncated in the admin list view.
|
||||
* Fix: Successful form submissions now forwards you to the appropriate url.
|
||||
* Fix: Lazy loaded thumbnail images in admin list view refined.
|
||||
* Fix: Better file upload validation and error messages.
|
||||
* New: List view now renders the description in html
|
||||
* New: Template drop down menus now lists all files in the directory.
|
||||
|
||||
= 1.1.5 =
|
||||
* New: Added multiple image per catalog item support.
|
||||
* New: Thumbnail images in the admin list view are now lazy loaded.
|
||||
* New: Navigation controls in the admin edit panel.
|
||||
* Fix: Rendering thumbnail and fullsize images are now separate threads.
|
||||
|
||||
= 1.1 =
|
||||
* New: Added CSV (comma separated values) support for importing and exporting catalog data.
|
||||
|
||||
= 1.0.2 =
|
||||
* New: New grid template default for showing product grids that use the item's link.
|
||||
* New: Title link relationship field now in title options.
|
||||
* New: Support for inserting tab characters into the template code.
|
||||
* New: Only load CataBlog frontend JavaScript and CSS on pages with the shortcode.
|
||||
* New: Thumbnail preview now has an image in options panel.
|
||||
* Fix: Updated gallery template default to link to the full size image.
|
||||
* Fix: Title link target attribute is now free form text in title options.
|
||||
|
||||
= 1.0.1 =
|
||||
* New: Added %IMAGE-FULLSIZE% token to the HTML template feature.
|
||||
|
||||
= 1.0 =
|
||||
* New: Rescan the originals folder for new images to add to the database.
|
||||
* New: Category filter in the CataBlog Admin Panel for quick filter previews.
|
||||
* New: Grid mode for easier resorting and photo gallery usages.
|
||||
* New: Bulk selection of items for the delete function.
|
||||
* Fix: Small interface bugs in LightBox when using an old browser.
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 1.2.5 =
|
||||
|
||||
LightBox JavaScript Library was upgraded, please upgrade your template code accordingly.
|
||||
http://catablog.illproductions.com for more information and specifics.
|
||||
|
||||
= 1.2 =
|
||||
|
||||
Category name and slug bug was fixed in this version, you may want to export and reimport after upgrading.
|
||||
http://catablog.illproductions.com for more information and specifics.
|
||||
|
||||
= 0.9.5 =
|
||||
|
||||
WARNING: Complete removal of all database manipulation code from CataBlog. This is very good, as all data storage and retrieval will be delegated by built in WordPress functions. To upgrade you will be required to Export and then Import your catalog data. After a successful Import, you may remove the old data from your database in the CataBlog > Options > Systems section . You should leave the images folder alone, as nothing much has changed when it comes to uploads and storage.
|
||||
BIN
src/wp-content/plugins/catablog/screenshot-1.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
src/wp-content/plugins/catablog/screenshot-2.jpg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
src/wp-content/plugins/catablog/screenshot-3.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
src/wp-content/plugins/catablog/screenshot-4.jpg
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
src/wp-content/plugins/catablog/screenshot-5.jpg
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
src/wp-content/plugins/catablog/screenshot-6.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
14
src/wp-content/plugins/catablog/templates/admin-404.php
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e('CataBlog Item Not Found', 'catablog'); ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<p><?php _e("You attempted to edit an item that doesn't exist. Perhaps it was deleted?", 'catablog'); ?></p>
|
||||
<ul>
|
||||
<li><strong><?php _e("Go To:", 'catablog'); ?></strong></li>
|
||||
<li><a href="admin.php?page=catablog"><?php _e("CataBlog Library", 'catablog'); ?></a></li>
|
||||
<li><a href="index.php"><?php _e("Dashboard", 'catablog'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
50
src/wp-content/plugins/catablog/templates/admin-about.php
Normal file
@ -0,0 +1,50 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("About CataBlog", 'catablog'); ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<p>
|
||||
<?php printf(__("%sCataBlog%s is written by %sZachary Segal%s in his spare time.", "catablog"),"<a href='http://catablog.illproductions.com/' target='_blank'>", "</a>", "<a href='http://catablog.illproductions.com/about-author/' target='_blank'>", "</a>"); ?>
|
||||
<?php printf(__('It is a cataloging tool for %sWordPress%s that allows you to easily manage a list of items with automatically generated thumbnail images.', "catablog"), "<a href='http://wordpress.org' target='_blank'>", "</a>"); ?>
|
||||
<?php printf(__('Use of CataBlog is completely free, even commercial sites for now, all that I ask is that you rate the plugin at the %sWordPress Plugin Repository%s.', "catablog"), "<a href='http://wordpress.org/extend/plugins/catablog/' target='_blank'>", "</a>"); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php printf(__("%sCSS Modifications:%s You may always override CataBlog's CSS settings to create custom looks. If you make a catablog.css file in your active theme's directory it will be automatically loaded and applied. This makes it easy to prepare your custom theme for CataBlog integration and will also protect your customization for future version to come.", 'catablog'), "<strong>", "</strong>"); ?>
|
||||
</p>
|
||||
|
||||
<table class="catablog_stats wide" cellspacing="5">
|
||||
<thead>
|
||||
<tr><td colspan="2"><h3><strong><?php _e("Server Statistics", 'catablog'); ?></strong></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($stats as $label => $value): ?>
|
||||
<tr>
|
||||
<?php $transformed_label = str_replace("_", " ", $label) . ":" ?>
|
||||
<td><strong><?php _e($transformed_label, 'catablog'); ?></strong></td>
|
||||
<td><?php echo $value ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
// CataBlog About Panel System Versions and Info Labels
|
||||
__('CataBlog Version:');
|
||||
__('MySQL Version:');
|
||||
__('PHP Version:');
|
||||
__('PHP Memory Usage:');
|
||||
__('PHP Memory Limit:');
|
||||
__('Max Uploaded File Size:');
|
||||
__('Max Post size:');
|
||||
__('Thumbnail Disc Usage:');
|
||||
__('Full Size Disc Usage:');
|
||||
__('Original Upload Disc Usage:');
|
||||
__('Total Disc Usage:');
|
||||
|
||||
?>
|
||||
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
|
||||
switch ($screen) {
|
||||
|
||||
|
||||
case 'toplevel_page_catablog':
|
||||
|
||||
if (isset($_GET['id'])) {
|
||||
$message = "<p>";
|
||||
$message .= __("You may edit your catalog entry as you see fit in this panel.", "catablog") . " ";
|
||||
$message .= __("Notice that the description accepts HTML code. This makes it easy to refine your catalog layout inside your description.", "catablog") . " ";
|
||||
$message .= "</p>";
|
||||
}
|
||||
else {
|
||||
$message = "<p>";
|
||||
$message .= __("CataBlog is a comprehensive and easy to use cataloging system for WordPress. ", "catablog");
|
||||
$message .= "<p>";
|
||||
$message .= __("Get started by making your first catalog item, click the <strong>Add New</strong> button near the page title. ", "catablog");
|
||||
$message .= "</p>";
|
||||
$message .= "<p>";
|
||||
$message .= sprintf(__("You may learn more about CataBlog at %scatablog.illproductions.com%s. ", "catablog"), "<a href='http://catablog.illproductions.com/' target='_blank'>", "</a>");
|
||||
$message .= "</p>";
|
||||
$message .= "<p>";
|
||||
$message .= sprintf(__("A lot of time and effort has gone into creating this plugin, %splease donate%s to Zach and help the continued development of CataBlog.", "catablog"), "<a href='http://catablog.illproductions.com/donate/' target='_blank'>", "</a>");
|
||||
$message .= "</p>";
|
||||
}
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
|
||||
case 'catablog_page_catablog-upload':
|
||||
$message = "<p>";
|
||||
$message .= __("To create a new catalog entry first upload an image by selecting a file and then clicking the upload button. ", "catablog");
|
||||
$message .= __("After the upload is successful a new catalog entry will be generated with the name of the file you uploaded. ", "catablog");
|
||||
$message .= "</p>";
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'catablog_page_catablog-options':
|
||||
$message = "<p>";
|
||||
$message .= __("CataBlog offer many options that let you modify your catalog and its appearance.", "catablog");
|
||||
$message .= "</p>";
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
|
||||
case 'catablog_page_catablog-about':
|
||||
$message = "<p>";
|
||||
$message .= __("Please make sure to support the plugin author by donating.", "catablog");
|
||||
$message .= "</p>";
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
|
||||
case 'admin_page_catablog-rescan-images':
|
||||
$message = "<p>";
|
||||
$message .= __("Your CataBlog originals upload folder is being scanned for any files that are not currently in the database.", "catablog");
|
||||
$message .= "</p>";
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
|
||||
case 'admin_page_catablog-regenerate-images':
|
||||
$message = "<p>";
|
||||
$message .= __("CataBlog is regenerating all the images in the CataBlog thumbnail and LightBox folders.", "catablog");
|
||||
$message .= "</p>";
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
|
||||
case 'admin_page_catablog-remove':
|
||||
$message = "<p>";
|
||||
$message .= __("CataBlog is being completely removed, afterwards you may go back to the library view to reinstall the default settings.", "catablog");
|
||||
$message .= __("If you wish to completely remove CataBlog, do not go to the library view, instead disable CataBlog after this is complete.", "catablog");
|
||||
$message .= "</p>";
|
||||
echo $message;
|
||||
break;
|
||||
|
||||
default:
|
||||
echo $contextual_help;
|
||||
|
||||
|
||||
}
|
||||
24
src/wp-content/plugins/catablog/templates/admin-discfull.php
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e('Storage Space Full!', 'catablog'); ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<p>
|
||||
<?php _e("CataBlog can't make a new entry because your site has run out of storage space.", 'catablog'); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php $current_usage = round((get_dirsize(BLOGUPLOADDIR) / 1024 / 1024), 2); ?>
|
||||
<?php sprintf(_e('You are currently using %sMB of %sMB of storage space.', 'catablog'), $current_usage, get_space_allowed()); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php _e('Please talk to your WordPress Administrator to have more space allocated to your site or delete some previous uploaded content.', 'catablog'); ?>
|
||||
</p>
|
||||
<ul>
|
||||
<li><strong><?php _e('Go To:', 'catablog'); ?></strong></li>
|
||||
<li><a href="index.php"><?php _e('Dashboard', 'catablog'); ?></a></li>
|
||||
<li><a href="upload.php"><?php _e('Media', 'catablog'); ?></a></li>
|
||||
<li><a href="admin.php?page=catablog"><?php _e('CataBlog', 'catablog'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
508
src/wp-content/plugins/catablog/templates/admin-edit.php
Normal file
@ -0,0 +1,508 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("Edit CataBlog Entry", 'catablog'); ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<form id="catablog-edit" class="catablog-form clear_float" method="post" action="admin.php?page=catablog-save" enctype="multipart/form-data">
|
||||
|
||||
<div id="catablog-edit-main">
|
||||
<div id="catablog-edit-main-content">
|
||||
<fieldset>
|
||||
<h3><span><?php _e("Main", "catablog"); ?></span></h3>
|
||||
|
||||
<div>
|
||||
<div id="catablog-edit-main-image">
|
||||
<label id="catablog-edit-images-label"><?php _e("Images", 'catablog'); ?></label>
|
||||
<div id="catablog-edit-images-column">
|
||||
|
||||
<img src="<?php echo $this->urls['thumbnails'] . "/" . $result->getImage() ?>" class="catablog-image-preview" />
|
||||
<input type="hidden" name="image" id="image" value="<?php echo $result->getImage() ?>" />
|
||||
|
||||
<hr />
|
||||
|
||||
<span id="catablog-edit-image-controls" class="hide-if-no-js">
|
||||
<a href="#replace-main-image" id="show-image-window"><small style="font-size:10px;"><?php _e("Replace Main Image", 'catablog'); ?></small></a>
|
||||
<br />
|
||||
<a href="#add-subimage" id="show-subimage-window"><small style="font-size:10px;">[+] <?php _e("Add Sub Image", 'catablog'); ?></small></a>
|
||||
</span>
|
||||
|
||||
<noscript><div class="error" style="border-width:1px;">
|
||||
<strong><small><?php _e("JavaScript is required to add images.", 'catablog'); ?></small></strong>
|
||||
</div></noscript>
|
||||
|
||||
<hr />
|
||||
|
||||
<?php if (count($result->getSubImages()) > 0): ?>
|
||||
<ul id="catablog-sub-images">
|
||||
<?php foreach ($result->getSubImages() as $sub_image): ?>
|
||||
<li>
|
||||
<img src="<?php echo $this->urls['thumbnails'] . "/$sub_image" ?>" class="catablog-image-preview" />
|
||||
<input type="hidden" name="sub_images[]" class="sub-image" value="<?php echo $sub_image ?>" />
|
||||
<a href="#delete" class="catablog-delete-subimage" title="<?php _e('Delete this sub image permanently.', 'catablog'); ?>">X</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p><small class="nonessential"><?php _e("No Sub Images", 'catablog'); ?></small></p>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div><!-- END div#catablog-edit-main-image -->
|
||||
|
||||
|
||||
<div id="catablog-edit-main-text">
|
||||
<label for="catablog-title"><?php _e("Title", 'catablog'); ?></label>
|
||||
<input type="text" name="title" id="catablog-title" maxlength="200" value="<?php echo htmlspecialchars($result->getTitle(), ENT_QUOTES, 'UTF-8') ?>" />
|
||||
|
||||
<?php if ($this->options['public_posts']): ?>
|
||||
<p><small>Permalink: <a href="<?php echo $result->getPermalink() ?>"><?php echo $result->getPermalink() ?></a></small></p>
|
||||
<?php else: ?>
|
||||
<p> </p>
|
||||
<?php endif ?>
|
||||
|
||||
<label for="catablog-description"><?php _e("Description", 'catablog'); ?> [<small><?php _e("accepts html formatting", 'catablog'); ?></small>]</label>
|
||||
<textarea name="description" id="catablog-description"><?php echo htmlspecialchars($result->getDescription(), ENT_QUOTES, 'UTF-8') ?></textarea>
|
||||
</div>
|
||||
|
||||
<div id="catablog-edit-main-save" class="clear_float">
|
||||
<input type="hidden" id="save" name="save" value="yes" />
|
||||
<?php wp_nonce_field( 'catablog_save', '_catablog_save_nonce', false, true ) ?>
|
||||
|
||||
<input type="hidden" id="saved_image" name="saved_image" value="<?php echo $result->getImage() ?>" />
|
||||
<input type="hidden" id="id" name="id" value="<?php echo $result->getId() ?>" />
|
||||
<input type="hidden" id="order" name="order" value="<?php echo $result->getOrder() ?>" />
|
||||
|
||||
<input type="submit" class="button-primary" id="save_changes" value="<?php _e("Save Changes", 'catablog'); ?>" />
|
||||
<span><?php printf(__("or %sback to list%s", 'catablog'), '<a href="admin.php?page=catablog">', '</a>'); ?></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="catablog-edit-params">
|
||||
<fieldset>
|
||||
<h3><label for="date"><?php _e("Attributes", 'catablog'); ?></label></h3>
|
||||
<div>
|
||||
<p>
|
||||
<span><?php printf(__("Date: %s", 'catablog'), date('M. jS, Y - H:i', strtotime($result->getDate()))) ?></span>
|
||||
<a href="#edit-date" id="activate-date-editor" class="alignright"><?php _e("edit", "catablog") ?></a>
|
||||
</p>
|
||||
<p id="date-editor" class="hide">
|
||||
<input type="text" name="date" id="date" class="text-field" value="<?php echo htmlspecialchars($result->getDate(), ENT_QUOTES, 'UTF-8') ?>" />
|
||||
<small>
|
||||
<?php _e("Format: YYYY-MM-DD HH:MM:SS", 'catablog'); ?>
|
||||
</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="order"><?php printf(__("Order: %s", 'catablog'), $result->getOrder()); ?></label>
|
||||
<a href="#edit-order" id="activate-order-editor" class="alignright"><?php _e("edit", "catablog") ?></a>
|
||||
</p>
|
||||
<p id="order-editor" class="hide">
|
||||
<input type="text" name="order" id="order" class="text-field" value="<?php echo htmlspecialchars($result->getOrder(), ENT_QUOTES, 'UTF-8') ?>" />
|
||||
<small>
|
||||
<?php _e("Enter a integer value to be assigned as this catalog item's order. There is only one order value per catalog item.", "catablog") ?>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<h3><?php _e('Fields', 'catablog'); ?></h3>
|
||||
<div id="catablog-fields">
|
||||
<p>
|
||||
<label for="link"><?php _e("Link", 'catablog'); ?></label>
|
||||
<a href="#help" class="show-help alignright"><?php _e("help", "catablog"); ?></a>
|
||||
<br />
|
||||
<input type="text" name="link" id="link" class="text-field" value="<?php echo htmlspecialchars($result->getLink(), ENT_QUOTES, 'UTF-8') ?>" />
|
||||
<small>
|
||||
<?php _e("Enter a relative or absolute web address to make this item a hyperlink. External links should start with http://.", 'catablog'); ?>
|
||||
</small>
|
||||
</p>
|
||||
<p>
|
||||
<label for="price"><?php _e("Item Price", 'catablog'); ?></label>
|
||||
<a href="#help" class="show-help alignright"><?php _e("help", "catablog"); ?></a>
|
||||
<br />
|
||||
<input type="text" name="price" id="price" class="text-field" value="<?php echo $result->getPrice() ?>">
|
||||
<small>
|
||||
<?php _e("If your catalog item has a price above zero, it will generate a buy now button you may display.", 'catablog'); ?>
|
||||
</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="product_code"><?php _e("Product Code", 'catablog'); ?></label>
|
||||
<a href="#help" class="show-help alignright"><?php _e("help", "catablog"); ?></a>
|
||||
<br />
|
||||
<input type="text" name="product_code" id="product_code" class="text-field" value="<?php echo htmlspecialchars($result->getProductCode(), ENT_QUOTES, 'UTF-8') ?>">
|
||||
<small>
|
||||
<?php _e("This field is intended for usage as a product code for the PayPal buy now buttons.", 'catablog'); ?>
|
||||
</small>
|
||||
</p>
|
||||
|
||||
<p><small class="hide">
|
||||
<?php printf(__("If you want to make a shopping cart you should make sure you are using a %sStore Template%s that uses these values.", 'catablog'), '<a href="admin.php?page=catablog-options#store">', '</a>'); ?>
|
||||
</small></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<h3><?php _e("Categories", 'catablog'); ?></h3>
|
||||
<div id="catablog-category" class="tabs-panel">
|
||||
|
||||
<ul id="catablog-category-checklist" class="list:category categorychecklist form-no-clear">
|
||||
|
||||
<?php $categories = $this->get_terms() ?>
|
||||
|
||||
<?php if (count($categories) < 1): ?>
|
||||
<li><span><?php _e("You currently have no categories.", 'catablog'); ?></span></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<li>
|
||||
<label class="catablog-category-row">
|
||||
<?php $checked = (in_array($category->term_id, array_keys($result->getCategories())))? 'checked="checked"' : '' ?>
|
||||
<input id="in-category-<?php echo $category->term_id ?>" type="checkbox" <?php echo $checked ?> name="categories[]" value="<?php echo $category->term_id ?>" />
|
||||
<?php $default_term = $this->get_default_term() ?>
|
||||
<?php if ($category->name != $default_term->name): ?>
|
||||
<a href="#delete" class="catablog-category-delete hide"><small><?php _e("[DELETE]", 'catablog'); ?></small></a>
|
||||
<?php endif ?>
|
||||
<span><?php echo $category->name ?></span>
|
||||
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
<div id="catablog-new-category">
|
||||
<noscript>
|
||||
<div class="error">
|
||||
<strong><small><?php _e("You must have a JavaScript enabled browser to create new categories.", 'catablog'); ?></small></strong>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<span class="hide">
|
||||
<input id="catablog-new-category-input" type="text" value="" />
|
||||
<a href="#new-category" id="catablog-new-category-submit" class="button"><?php _e('New', 'catablog'); ?></a>
|
||||
<img src="<?php echo $this->urls['images'] ?>/ajax-loader-small.gif" id="catablog-new-category-load" class="hide" />
|
||||
</span>
|
||||
</div>
|
||||
<p><small>
|
||||
<?php _e("Put your items into categories to easily display subsets of your catalog on different pages.", 'catablog'); ?><br />
|
||||
<strong><?php _e('ex:', 'catablog'); ?></strong> [catablog category="dogs and cats"]
|
||||
</small></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div><!-- END #wrap -->
|
||||
|
||||
|
||||
<div id='catablog_load_curtain'> </div>
|
||||
|
||||
<div id="add-subimage-window" class="catablog-modal">
|
||||
<form id="catablog-add-subimage" class="catablog-form" method="post" action="admin.php?page=catablog-add-subimage" enctype="multipart/form-data">
|
||||
<h3 class="catablog-modal-title">
|
||||
<span style="float:right;"><a href="#" class="hide-modal-window"><?php _e("[close]", 'catablog'); ?></a></span>
|
||||
<strong><?php _e("Upload A New Sub Image", 'catablog'); ?></strong>
|
||||
</h3>
|
||||
<div class="catablog-modal-body">
|
||||
<p><strong><?php _e("Save Other Changes Before Uploading A New Image.", 'catablog'); ?></strong></p>
|
||||
|
||||
<input type="file" id="new_sub_image" name="new_sub_image" />
|
||||
<span class="nonessential"> | </span>
|
||||
<input type="hidden" name="id" value="<?php echo $result->getId() ?>" >
|
||||
|
||||
<?php wp_nonce_field( 'catablog_add_subimage', '_catablog_add_subimage_nonce', false, true ) ?>
|
||||
<input type="submit" name="save" value="<?php _e("Upload", 'catablog'); ?>" class="button-primary" />
|
||||
<p><small>
|
||||
<?php _e("Select an image to add as a sub image, this upload will not replace this item's main image.", 'catablog'); ?><br />
|
||||
<?php _e("You may upload JPEG, GIF and PNG graphic formats only.", "catablog"); ?><br />
|
||||
<strong><?php _e("No animated GIFs please.", "catablog"); ?></strong>
|
||||
</small></p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="replace-image-window" class="catablog-modal">
|
||||
<form id="catablog-replace-image" class="catablog-form" method="post" action="admin.php?page=catablog-replace-image" enctype="multipart/form-data">
|
||||
<h3 class="catablog-modal-title">
|
||||
<span style="float:right;"><a href="#" class="hide-modal-window"><?php _e("[close]", 'catablog'); ?></a></span>
|
||||
<strong><?php _e("Replace The Main Image", 'catablog'); ?></strong>
|
||||
</h3>
|
||||
<div class="catablog-modal-body">
|
||||
<p><strong><?php _e("Save Other Changes Before Uploading A New Image.", 'catablog'); ?></strong></p>
|
||||
<input type="file" id="new_image" name="new_image" />
|
||||
<span class="nonessential"> | </span>
|
||||
<input type="hidden" name="id" value="<?php echo $result->getId() ?>" >
|
||||
|
||||
<?php wp_nonce_field( 'catablog_replace_image', '_catablog_replace_image_nonce', false, true ) ?>
|
||||
<input type="submit" name="save" value="<?php _e("Upload", 'catablog'); ?>" class="button-primary" />
|
||||
<p><small>
|
||||
<?php _e("Select an image on your computer to upload and replace this item's main image with.", 'catablog'); ?><br />
|
||||
<?php _e("You may upload JPEG, GIF and PNG graphic formats only.", "catablog"); ?><br />
|
||||
<strong><?php _e("No animated GIFs please.", "catablog"); ?></strong><br /><br >
|
||||
<strong><?php _e("This will replace the main image, forever deleting the current main image.", 'catablog'); ?></strong>
|
||||
|
||||
</small></p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
// FOCUS ON THE TITLE INPUT BOX
|
||||
$('#catablog-title').focus();
|
||||
|
||||
// SHOW THE NEW CATEGORY FORM IF JAVASCRIPT IS ENABLED
|
||||
$('#catablog-new-category span').show();
|
||||
|
||||
// BIND SORTABLE IMAGES
|
||||
$('#catablog-sub-images').sortable({
|
||||
cursor: 'crosshair',
|
||||
forcePlaceholderSize: true,
|
||||
opacity: 0.7,
|
||||
revert: 200
|
||||
})
|
||||
|
||||
// BIND DATE EDITOR
|
||||
$('#activate-date-editor').click(function() {
|
||||
$('#date-editor').slideDown();
|
||||
$(this).fadeOut();
|
||||
});
|
||||
|
||||
// BIND ORDER EDITOR
|
||||
$('#activate-order-editor').click(function() {
|
||||
$('#order-editor').slideDown();
|
||||
$(this).fadeOut();
|
||||
});
|
||||
|
||||
//
|
||||
$('#catablog-fields small').css('display','block').hide();
|
||||
$('#catablog-fields .show-help').click(function() {
|
||||
$(this).siblings('small').slideDown();
|
||||
$(this).fadeOut();
|
||||
});
|
||||
|
||||
// BIND CATEGORY LIST HOVERS
|
||||
$('#catablog-category-checklist li label').live('mouseover', function(event) {
|
||||
$(this).addClass('hover');
|
||||
if (!catablog_category_is_loading()) {
|
||||
$('a.catablog-category-delete', this).show();
|
||||
}
|
||||
});
|
||||
$('#catablog-category-checklist li label').live('mouseout', function(event) {
|
||||
$(this).removeClass('hover');
|
||||
$('a.catablog-category-delete', this).hide();
|
||||
});
|
||||
|
||||
// BIND DELETE CATEGORY LINKS
|
||||
$('#catablog-category-checklist li label a.catablog-category-delete').live('click', function(event) {
|
||||
// stop javascript event propagation and set this variable
|
||||
event.stopPropagation();
|
||||
var object = this;
|
||||
|
||||
// make sure category changes aren't still loading
|
||||
if (catablog_category_is_loading()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm the deletion of the category
|
||||
if (!confirm('<?php _e("Are you sure you want to delete this category? You can not undo this.", "catablog") ?>')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// show the load indicator and disable new category button
|
||||
catablog_category_show_load();
|
||||
|
||||
// setup AJAX params
|
||||
var term_id = $(this).siblings('input').val();
|
||||
var params = {
|
||||
'action': 'catablog_delete_category',
|
||||
'security': '<?php echo wp_create_nonce("catablog-delete-category") ?>',
|
||||
'term_id': term_id
|
||||
}
|
||||
|
||||
// make AJAX call
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.error);
|
||||
}
|
||||
else {
|
||||
var category = $(object).parent().parent();
|
||||
$(category).animate({'opacity':0, 'height':0, 'padding':0, 'margin':0}, 500, function() {
|
||||
$(category).remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
alert(error);
|
||||
}
|
||||
|
||||
// hide load indicator and enable new category button
|
||||
catablog_category_hide_load();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// BIND NEW CATEGORY TEXT INPUT BOX
|
||||
$('#catablog-new-category-input').bind('keypress', function(event) {
|
||||
var key_code = (event.keyCode ? event.keyCode : event.which);
|
||||
if (key_code == 13) {
|
||||
$('#catablog-new-category-submit').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// BIND NEW CATEGORY FORM
|
||||
$('#catablog-new-category-submit').bind('click', function(event) {
|
||||
// if button disabled don't do anything
|
||||
if (catablog_category_is_loading()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if category name is set
|
||||
var category_name = $('#catablog-new-category-input').val();
|
||||
if (category_name == '') {
|
||||
alert('<?php _e("Please make sure to enter a category name", "catablog") ?>');
|
||||
return false;
|
||||
}
|
||||
|
||||
// show load indicators and disable button
|
||||
catablog_category_show_load();
|
||||
|
||||
// set AJAX params
|
||||
var params = {
|
||||
'action': 'catablog_new_category',
|
||||
'security': '<?php echo wp_create_nonce("catablog-new-category") ?>',
|
||||
'name': category_name
|
||||
}
|
||||
|
||||
// make AJAX call
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.error);
|
||||
}
|
||||
else {
|
||||
var html = '<li><label class="catablog-category-row">';
|
||||
html += ' <input id="in-category-'+json.id+'" type="checkbox" checked="checked" name="categories[]" value="'+json.id+'" /> ';
|
||||
html += ' <a href="#delete" class="catablog-category-delete hide"><small><?php echo _e("[DELETE]", "catablog") ?></small></a>';
|
||||
html += ' <span>'+json.name+'</span> ';
|
||||
html += '</label></li>';
|
||||
|
||||
$('#catablog-category-checklist').append(html);
|
||||
$('#catablog-new-category-input').val('');
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
alert(error);
|
||||
}
|
||||
|
||||
// hide load indicators and enable button
|
||||
catablog_category_hide_load();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// BIND REPLACE MAIN IMAGE MODAL WINDOW
|
||||
$('#show-image-window').bind('click', function(event) {
|
||||
jQuery('#replace-image-window').show();
|
||||
jQuery('#catablog_load_curtain').fadeTo(200, 0.8);
|
||||
return false;
|
||||
});
|
||||
|
||||
// BIND ADD SUB IMAGE MODAL WINDOW
|
||||
$('#show-subimage-window').bind('click', function(event) {
|
||||
jQuery('#add-subimage-window').show();
|
||||
jQuery('#catablog_load_curtain').fadeTo(200, 0.8);
|
||||
return false;
|
||||
});
|
||||
|
||||
// BIND HIDE MODAL WINDOW
|
||||
$('.hide-modal-window').bind('click', function(event) {
|
||||
jQuery('.catablog-modal:visible').hide();
|
||||
jQuery('#catablog_load_curtain').fadeOut(200);
|
||||
return false;
|
||||
});
|
||||
|
||||
// BIND DELETE SUB IMAGE
|
||||
$('#catablog-sub-images .catablog-delete-subimage').bind('click', function(event) {
|
||||
if (!confirm('<?php _e("Are you sure you want to permanently delete this image?", "catablog") ?>')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var id = $('#id').val();
|
||||
var image = $(this).siblings('input').val();
|
||||
|
||||
var params = {
|
||||
'action': 'catablog_delete_subimage',
|
||||
'security': '<?php echo wp_create_nonce("catablog-delete-subimage") ?>',
|
||||
'id': id,
|
||||
'image': image
|
||||
}
|
||||
|
||||
disable_save_button();
|
||||
|
||||
// make AJAX call
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.error);
|
||||
}
|
||||
else {
|
||||
$(self).parent().animate({opacity:0, height:0, margin:0}, 800, function() {
|
||||
$(this).remove();
|
||||
enable_save_button();
|
||||
});
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
alert(error);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function catablog_category_show_load() {
|
||||
$('#catablog-new-category-load').show();
|
||||
$('#catablog-new-category-submit').addClass('disabled');
|
||||
}
|
||||
|
||||
function catablog_category_hide_load() {
|
||||
$('#catablog-new-category-load').hide();
|
||||
$('#catablog-new-category-submit').removeClass('disabled');
|
||||
}
|
||||
|
||||
function catablog_category_is_loading() {
|
||||
return $('#catablog-new-category-submit').hasClass('disabled');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
28
src/wp-content/plugins/catablog/templates/admin-export.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php echo '<?xml version="1.0" encoding="UTF-8" ?>' ?>
|
||||
|
||||
<catablog_items date="<?php echo date('Y-m-d') ?>" time="<?php echo date('H:i:s') ?>">
|
||||
|
||||
<?php foreach ($results as $result): ?>
|
||||
<item>
|
||||
<image><![CDATA[<?php echo $result->getImage() ?>]]></image>
|
||||
<subimages>
|
||||
<?php foreach ($result->getSubImages() as $image): ?>
|
||||
<image><![CDATA[<?php echo $image ?>]]></image>
|
||||
<?php endforeach ?>
|
||||
</subimages>
|
||||
<title><![CDATA[<?php echo $result->getTitle() ?>]]></title>
|
||||
<description><![CDATA[<?php echo $result->getDescription() ?>]]></description>
|
||||
<date><?php echo $result->getDate() ?></date>
|
||||
<order><?php echo $result->getOrder() ?></order>
|
||||
<link><![CDATA[<?php echo $result->getLink() ?>]]></link>
|
||||
<price><![CDATA[<?php echo $result->getPrice() ?>]]></price>
|
||||
<product_code><![CDATA[<?php echo $result->getProductCode() ?>]]></product_code>
|
||||
<categories>
|
||||
<?php foreach ($result->getCategories() as $cat_id => $cat_name): ?>
|
||||
<category><![CDATA[<?php echo $cat_name ?>]]></category>
|
||||
<?php endforeach ?>
|
||||
</categories>
|
||||
</item>
|
||||
<?php endforeach ?>
|
||||
|
||||
</catablog_items>
|
||||
29
src/wp-content/plugins/catablog/templates/admin-grid.php
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
<ul id="catablog_items" class="catablog-grid-view">
|
||||
|
||||
<?php if (count($results) < 1): ?>
|
||||
<p><?php _e("No catalog items found", 'catablog'); ?></p>
|
||||
|
||||
<?php if ($selected_term !== false): ?>
|
||||
<p><?php _e("Use the category drop down above to switch category views.", 'catablog'); ?></p>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($results as $result): ?>
|
||||
<?php $edit = 'admin.php?page=catablog&id='.$result->getId() ?>
|
||||
<?php $remove = 'admin.php?page=catablog-delete&id='.$result->getId() ?>
|
||||
<li>
|
||||
<a href="<?php echo $edit ?>" class="catablog-admin-thumbnail"><img src="<?php echo $this->urls['thumbnails'] . "/" . $result->getImage() ?>" class="catablog-grid-thumbnail" width="100" height="100" alt="" /></a>
|
||||
|
||||
<a href="<?php echo $edit ?>" class="catablog-title"><small>
|
||||
<?php $truncated_title = (function_exists('mb_substr'))? mb_substr($result->getTitle(), 0, 30) : substr($result->getTitle(), 0, 30) ?>
|
||||
<?php $title = ($result->string_length($result->getTitle()) > 30)? trim($truncated_title).'...' : $result->getTitle() ?>
|
||||
<?php echo htmlentities($title, ENT_QUOTES, 'UTF-8') ?>
|
||||
</small></a>
|
||||
|
||||
<input type="checkbox" class="bulk_selection" name="bulk_action_id" value="<?php echo $result->getId() ?>" />
|
||||
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<li class="clear"> </li>
|
||||
</ul>
|
||||
42
src/wp-content/plugins/catablog/templates/admin-import.php
Normal file
@ -0,0 +1,42 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("CataBlog Import Results", 'catablog'); ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<h3><strong><?php _e("Import Console", 'catablog'); ?></strong></h3>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<p>
|
||||
<?php _e("You must select a valid XML or CSV file to be used for import.", 'catablog'); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php printf(__("You may choose to read more about %simporting and exporting data from CataBlog%s.", 'catablog'), '<a href="http://catablog.illproductions.com/documentation/importing-and-exporting-catalogs/" target="_blank">', '</a>'); ?>
|
||||
<br />
|
||||
<?php printf(__("Once you have fixed your file and its format please %stry again%s.", 'catablog'), '<a href="admin.php?page=catablog-options#import">', '</a>'); ?>
|
||||
</p>
|
||||
<?php else: ?>
|
||||
<ul id="catablog-import-messages">
|
||||
<?php if (isset($_REQUEST['catablog_clear_db'])): ?>
|
||||
|
||||
<li class="updated"><em><?php _e("removing catalog items...", 'catablog'); ?></em></li>
|
||||
<?php $items = CataBlogItem::getItems() ?>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?php $item->delete(false) ?>
|
||||
<?php endforeach ?>
|
||||
<li class="updated"><?php _e("Success: <em>All</em> catalog items removed successfully", 'catablog'); ?></li>
|
||||
|
||||
<li class="updated"><em><?php _e("removing catalog categories...", 'catablog'); ?></em></li>
|
||||
<?php $this->remove_terms() ?>
|
||||
<li class="updated"><?php _e("Success: <em>All</em> catalog categories removed successfully", 'catablog'); ?></li>
|
||||
|
||||
<li class="updated"><strong><?php _e("DataBase Cleared Successfully", 'catablog'); ?></strong></li>
|
||||
<li> </li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php $this->load_array_to_database($data) ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
433
src/wp-content/plugins/catablog/templates/admin-library.php
Normal file
@ -0,0 +1,433 @@
|
||||
<?php $current_cat = (isset($_GET['category']))? '&category='.$_GET['category'] : '' ?>
|
||||
<?php $current_page = (isset($_GET['paged']))? '&paged='.$_GET['paged'] : ''?>
|
||||
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2>
|
||||
<span><?php _e("CataBlog Library", 'catablog'); ?></span>
|
||||
<a href="admin.php?page=catablog-upload" class="button add-new-h2"><?php _e("Add New", 'catablog'); ?></a>
|
||||
|
||||
</h2>
|
||||
<div id="message" class="updated hide">
|
||||
<strong> </strong>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
<div class="error">
|
||||
<strong><?php _e("You must have a JavaScript enabled browser for bulk actions and to change the order of your items.", 'catablog'); ?>
|
||||
<a href="http://www.google.com/search?q=what+is+javascript"><?php _e("Learn More", 'catablog'); ?></a></strong>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<div class="tablenav">
|
||||
|
||||
<form id="catablog-bulk-action-form" method="post" action="admin.php?page=catablog-bulkedit" class="alignleft actions hide">
|
||||
<input type="hidden" name="page" value="catablog-bulkedit" />
|
||||
<input type="hidden" name="reference" value="admin.php?page=catablog<?php echo $current_cat ?><?php echo $current_page ?>" />
|
||||
<?php wp_nonce_field( 'catablog_bulkedit', '_catablog_bulkedit_nonce', false, true ) ?>
|
||||
|
||||
<select id="bulk-action" name="bulk-action">
|
||||
<option value="">- <?php _e("Bulk Actions", 'catablog'); ?></option>
|
||||
<option value="edit-category"><?php _e("Edit Categories", 'catablog'); ?></option>
|
||||
<option value="delete"><?php _e("Delete", 'catablog'); ?></option>
|
||||
</select>
|
||||
|
||||
<input type="submit" value="<?php _e("Apply", 'catablog'); ?>" class="button-secondary" />
|
||||
<small>|</small>
|
||||
</form>
|
||||
|
||||
<form method="get" action="admin.php?page=catablog" class="alignleft actions">
|
||||
<label for="cat"><?php _e('View', 'catablog') ?>:</label>
|
||||
<input type="hidden" name="page" value="catablog" />
|
||||
<select id="cat" name="category" class="postform">
|
||||
<option value="-1">- <?php _e("All Categories", 'catablog'); ?></option>
|
||||
<?php $categories = $this->get_terms() ?>
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<?php $selected = ($category->term_id == $selected_term->term_id)? 'selected="selected"' : '' ?>
|
||||
<option value="<?php echo $category->term_id ?>" <?php echo $selected ?> ><?php echo $category->name ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<input type="submit" value="Filter" id="catablog-submit-filter" class="button-secondary" />
|
||||
|
||||
<?php /*
|
||||
<small>|</small>
|
||||
|
||||
<?php $disabled = (!isset($_GET['category']) || $_GET['category'] > 0)? '' : 'disabled="disabled"' ?>
|
||||
<a href="#sort" id="enable_sort" <?php echo $disabled ?> class="button"><?php _e("Change Order", 'catablog'); ?></a>
|
||||
*/ ?>
|
||||
</form>
|
||||
|
||||
|
||||
<form class="tablenav-pages" action="" method="get">
|
||||
<span class="displaying-num"><?php printf(__('%s items', 'catablog'), $total_catalog_items) ?></span> <!-- elementos -->
|
||||
|
||||
<?php if ($total_catalog_items > $limit): ?>
|
||||
|
||||
<a class='first-page <?php echo ($paged < 2)? 'disabled' : '' ?>' title='<?php _e('Go to the first page', 'catablog') ?>' href='<?php echo $first_catalog_page_link ?>'>«</a>
|
||||
<a class='prev-page <?php echo ($paged < 2)? 'disabled' : '' ?>' title='<?php _e('Go to the previous page', 'catablog') ?>' href='<?php echo $prev_catalog_page_link ?>'>‹</a>
|
||||
|
||||
<span class="paging-input">
|
||||
<input type="hidden" name="page" value="catablog" />
|
||||
<input class='current-page' title='<?php _e('Current page') ?>' type='text' name='paged' value='<?php echo $paged ?>' size='1' />
|
||||
<?php _e('of', 'catablog') ?>
|
||||
<span class='total-pages'><?php echo $total_catalog_pages ?></span>
|
||||
</span>
|
||||
|
||||
<a class='next-page <?php echo ($paged >= $total_catalog_pages)? 'disabled' : '' ?>' title='<?php _e('Go to the next page', 'catablog') ?>' href='<?php echo $next_catalog_page_link ?>'>›</a>
|
||||
<a class='last-page <?php echo ($paged >= $total_catalog_pages)? 'disabled' : '' ?>' title='<?php _e('Go to the last page', 'catablog') ?>' href='<?php echo $last_catalog_page_link ?>'>»</a>
|
||||
<?php endif ?>
|
||||
</form>
|
||||
|
||||
|
||||
<div id="catablog-view-switch" class="view-switch">
|
||||
<?php $list_class = ($view == 'list')? 'class="current"' : 'class=""' ?>
|
||||
<?php $grid_class = ($view == 'grid')? 'class="current"' : 'class=""' ?>
|
||||
<?php $meta = 'width="20" height="20" border="0"'; ?>
|
||||
|
||||
<a href="admin.php?page=catablog<?php echo $current_cat ?><?php echo $current_page ?>&view=list">
|
||||
<img src="<?php echo $this->urls['images'] ?>/blank.gif" id="view-switch-list" <?php echo "$list_class $meta" ?> title="<?php _e("List View", 'catablog'); ?>" alt="<?php _e("List View", 'catablog'); ?>"/>
|
||||
</a>
|
||||
<a href="admin.php?page=catablog<?php echo $current_cat ?><?php echo $current_page ?>&view=grid">
|
||||
<img src="<?php echo $this->urls['images'] ?>/blank.gif" id="view-switch-excerpt" <?php echo "$grid_class $meta" ?> title="<?php _e("Grid View", 'catablog'); ?>" alt="<?php _e("Grid View", 'catablog'); ?>"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($view == 'grid') {
|
||||
include_once($this->directories['template'] . '/admin-grid.php');
|
||||
}
|
||||
else {
|
||||
include_once($this->directories['template'] . '/admin-list.php');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php if ($total_catalog_items > $limit): ?>
|
||||
<div class="tablenav">
|
||||
<form class="tablenav-pages" action="" method="get">
|
||||
<span class="displaying-num"><?php printf(__('%s items', 'catablog'), $total_catalog_items) ?></span> <!-- elementos -->
|
||||
|
||||
<a class='first-page <?php echo ($paged < 2)? 'disabled' : '' ?>' title='<?php _e('Go to the first page', 'catablog') ?>' href='<?php echo $first_catalog_page_link ?>'>«</a>
|
||||
<a class='prev-page <?php echo ($paged < 2)? 'disabled' : '' ?>' title='<?php _e('Go to the previous page', 'catablog') ?>' href='<?php echo $prev_catalog_page_link ?>'>‹</a>
|
||||
|
||||
<span class="paging-input">
|
||||
<input type="hidden" name="page" value="catablog" />
|
||||
<input class='current-page' title='<?php _e('Current page') ?>' type='text' name='paged' value='<?php echo $paged ?>' size='1' />
|
||||
<?php _e('of', 'catablog') ?>
|
||||
<span class='total-pages'><?php echo $total_catalog_pages ?></span>
|
||||
</span>
|
||||
|
||||
<a class='next-page <?php echo ($paged >= $total_catalog_pages)? 'disabled' : '' ?>' title='<?php _e('Go to the next page', 'catablog') ?>' href='<?php echo $next_catalog_page_link ?>'>›</a>
|
||||
<a class='last-page <?php echo ($paged >= $total_catalog_pages)? 'disabled' : '' ?>' title='<?php _e('Go to the last page', 'catablog') ?>' href='<?php echo $last_catalog_page_link ?>'>»</a>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<div id='catablog_load_curtain'> </div>
|
||||
|
||||
<div id="edit-category-window" class="catablog-modal">
|
||||
<form id="catablog-edit-category" class="catablog-form" method="post" action="admin.php?page=catablog-bulkedit">
|
||||
<h3 class="catablog-modal-title">
|
||||
<span style="float:right;"><a href="#" class="hide-modal-window"><?php _e("[close]", 'catablog'); ?></a></span>
|
||||
<strong><?php _e("Edit Multiple Catalog Item's Categories", 'catablog'); ?></strong>
|
||||
</h3>
|
||||
|
||||
<div class="catablog-modal-body">
|
||||
<div id="catablog-category-add-checklist">
|
||||
<strong class="list-title">[+] <?php _e("Add to categories", "catablog") ?></strong>
|
||||
<ul class="list:category categorychecklist form-no-clear">
|
||||
|
||||
<?php $categories = $this->get_terms() ?>
|
||||
<?php if (count($categories) < 1): ?>
|
||||
<li><span><?php _e("You have no categories.", 'catablog'); ?></span></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<li>
|
||||
<label class="catablog-category-row">
|
||||
<input id="in-category-<?php echo $category->term_id ?>" type="checkbox" name="categories-add[]" value="<?php echo $category->term_id ?>" />
|
||||
<span><?php echo $category->name ?></span>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="catablog-category-remove-checklist">
|
||||
<strong class="list-title">[-] <?php _e("Remove from categories", "catablog") ?></strong>
|
||||
<ul class="list:category categorychecklist form-no-clear">
|
||||
|
||||
<?php $categories = $this->get_terms() ?>
|
||||
<?php if (count($categories) < 1): ?>
|
||||
<li><span><?php _e("You have no categories.", 'catablog'); ?></span></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<li>
|
||||
<label class="catablog-category-row">
|
||||
<input id="in-category-<?php echo $category->term_id ?>" type="checkbox" name="categories-remove[]" value="<?php echo $category->term_id ?>" />
|
||||
<span><?php echo $category->name ?></span>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<?php wp_nonce_field( 'catablog_bulkedit', '_catablog_bulkedit_nonce', false, true ) ?>
|
||||
<input type="hidden" name="page" value="catablog-bulkedit" />
|
||||
<input type="hidden" name="bulk-action" value="edit-category" />
|
||||
<input type="hidden" name="reference" value="admin.php?page=catablog<?php echo $current_cat ?><?php echo $current_page ?>" />
|
||||
|
||||
<input type="submit" name="save" value="<?php _e("Change Multiple Categories", 'catablog'); ?>" class="button-primary" />
|
||||
<p><small>
|
||||
<?php _e("Select the categories you would like each selected item to be part of by checking their boxes.", 'catablog'); ?><br />
|
||||
<?php _e("After the bulk edit, the selected items will be in only the categories selected above.", "catablog"); ?><br />
|
||||
</small></p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var timer = null;
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
** form bindings that should happen first
|
||||
*************************************************************************************/
|
||||
// show the bulk actions form and bind form submission;
|
||||
$('#catablog-bulk-action-form').show().bind('submit', function(event) {
|
||||
var self = this;
|
||||
|
||||
if ($('#bulk-action').val().length < 1) {
|
||||
alert('<?php _e("Please select a bulk action to apply.", "catablog"); ?>');
|
||||
return false;
|
||||
}
|
||||
|
||||
// get selected (checked) catalog items
|
||||
var checked_catalog_items = $('#catablog_items input.bulk_selection:checked');
|
||||
if (checked_catalog_items.size() < 1) {
|
||||
alert('<?php _e("Please select at least one catalog item first.", "catablog"); ?>');
|
||||
return false;
|
||||
}
|
||||
|
||||
// change the category of multiple catalog items
|
||||
if ($('#bulk-action').val() == 'edit-category') {
|
||||
|
||||
jQuery('#edit-category-window').show();
|
||||
jQuery('#catablog_load_curtain').fadeTo(200, 0.8);
|
||||
|
||||
checked_catalog_items.each(function() {
|
||||
$('#catablog-edit-category').append("<input type='hidden' name='bulk_selection[]' value='"+this.value+"' />");
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// delete multiple catalog items
|
||||
if ($('#bulk-action').val() == 'delete') {
|
||||
if (!confirm('<?php _e("Are you sure you want to delete multiple items?", "catablog"); ?>')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
checked_catalog_items.each(function() {
|
||||
$(self).append("<input type='hidden' name='bulk_selection[]' value='"+this.value+"' />");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// hide the filter button and bind live category switching
|
||||
$('#catablog-submit-filter').hide();
|
||||
$('#cat.postform').bind('change', function(event) {
|
||||
$(this).closest('form').submit();
|
||||
});
|
||||
|
||||
|
||||
// BIND HIDE MODAL WINDOW
|
||||
$('.hide-modal-window').bind('click', function(event) {
|
||||
jQuery('.catablog-modal:visible').hide();
|
||||
jQuery('#catablog_load_curtain').fadeOut(200);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// BIND TRASH CATALOG ITEM WARNING
|
||||
$('.remove_link').bind('click', function(event) {
|
||||
return (confirm('<?php _e("Are you sure you want to permanently delete this catalog items?", "catablog"); ?>'));
|
||||
});
|
||||
|
||||
|
||||
// BIND THE SCREEN SETTINGS AJAX SAVE
|
||||
$('.hide-catablog-column-tog').bind('change', function(event) {
|
||||
var column_class = "." + this.id.replace("hide-", "");
|
||||
|
||||
if (!this.checked) {
|
||||
$(column_class).hide();
|
||||
}
|
||||
else {
|
||||
$(column_class).show();
|
||||
}
|
||||
|
||||
saveScreenSettings();
|
||||
});
|
||||
$('#entry_per_page').bind('change', function(event) {
|
||||
saveScreenSettings();
|
||||
});
|
||||
|
||||
// SAVE SCREEN SETTINGS PANEL WITH AJAX
|
||||
function saveScreenSettings() {
|
||||
var hide = []
|
||||
var params = {
|
||||
'action': 'catablog_update_screen_settings',
|
||||
'security': '<?php echo wp_create_nonce("catablog-update-screen-settings") ?>',
|
||||
}
|
||||
|
||||
// var form_values = {};
|
||||
$('#adv-settings input').each(function() {
|
||||
var name = $(this).attr('name');
|
||||
var value = $(this).attr('value');
|
||||
|
||||
if ($(this).attr('type') == 'checkbox') {
|
||||
if ($(this).attr('checked')) {
|
||||
hide.push(value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
params[name] = value;
|
||||
}
|
||||
});
|
||||
|
||||
params.hide = hide;
|
||||
|
||||
// make AJAX call
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.error);
|
||||
}
|
||||
else {
|
||||
// do nothing on success
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
alert(error);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<?php /*
|
||||
|
||||
// lazy load the images
|
||||
calculate_lazy_loads();
|
||||
$(window).bind('scroll resize', function(event) {
|
||||
calculate_lazy_loads();
|
||||
});
|
||||
|
||||
|
||||
// initialize the sortables
|
||||
var catablog_items_path = "#catablog_items";
|
||||
$(catablog_items_path).sortable({
|
||||
disabled: true,
|
||||
forcePlaceholderSize: true,
|
||||
opacity: 0.7,
|
||||
<?php echo ($view == 'list')? "axis: 'y'" : "" ?>
|
||||
});
|
||||
|
||||
|
||||
$('#enable_sort').bind('click', function(event) {
|
||||
if ($(this).attr('disabled')) {
|
||||
alert('<?php _e("This feature only works when viewing a single category.", "catablog"); ?>');
|
||||
return false;
|
||||
}
|
||||
|
||||
var items = $(catablog_items_path);
|
||||
if ($(this).hasClass('button-primary')) {
|
||||
|
||||
// disable sortable and save order using ajax
|
||||
items.sortable('option', 'disabled', true);
|
||||
ajax_save_order();
|
||||
|
||||
// remove disable link classes and show bulk selection
|
||||
items.find('a').removeClass('cb_disabled_link');
|
||||
items.find('input.bulk_selection').show();
|
||||
unbind_discourage_leaving_page();
|
||||
|
||||
// enable selection of text and remove sort enabled class
|
||||
items.enableSelection();
|
||||
items.removeClass('sort_enabled');
|
||||
|
||||
// swap button to original state
|
||||
$(this).html('Change Order').removeClass('button-primary');
|
||||
}
|
||||
else {
|
||||
|
||||
// disable links, hide bulk selection and discourage leaving page
|
||||
items.find('a').addClass('cb_disabled_link');
|
||||
items.find('input.bulk_selection').hide();
|
||||
|
||||
discourage_leaving_page('<?php _e("You have not saved your order. If you leave now you will loose your changes. Are you sure you want to continue leaving this page?", "catablog"); ?>');
|
||||
|
||||
// disable selection of text and add sort enabled class
|
||||
items.disableSelection();
|
||||
items.addClass('sort_enabled');
|
||||
|
||||
// enable sortable items
|
||||
items.sortable('option', 'disabled', false);
|
||||
|
||||
// display helpful message to user
|
||||
var help_message = '<?php _e("Drag the items below to rearrange their order.", "catablog"); ?>';
|
||||
$('#message strong').html(help_message);
|
||||
$('#message').show();
|
||||
|
||||
// swap button to active state
|
||||
$(this).html('Save Order').addClass('button-primary');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function ajax_save_order() {
|
||||
var ids = [];
|
||||
$('#catablog_items input.bulk_selection').each(function(i) {
|
||||
var id = $(this).attr('value');
|
||||
ids.push(id);
|
||||
});
|
||||
|
||||
var params = {
|
||||
'action': 'catablog_reorder',
|
||||
'security': '<?php echo wp_create_nonce("catablog-reorder") ?>',
|
||||
'ids[]': ids
|
||||
}
|
||||
|
||||
$('#message strong').html('<?php _e("Saving new catalog order...", "catablog"); ?>');
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
$('#message strong').html('<?php _e("Your catalog items have been rearranged successfully.", "catablog"); ?>');
|
||||
});
|
||||
}
|
||||
*/
|
||||
?>
|
||||
|
||||
});
|
||||
</script>
|
||||
114
src/wp-content/plugins/catablog/templates/admin-list.php
Normal file
@ -0,0 +1,114 @@
|
||||
<table class="widefat post" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="column-cb check-column"><input type="checkbox" /></th>
|
||||
<th class="cb_icon_column"><?php _e("Image", "catablog"); ?></th>
|
||||
<?php $css_sort = ($sort=='title')? "sorted" : "sortable" ?>
|
||||
<?php $sort_url = ($order=='asc')? "&order=desc" : "&order=asc" ?>
|
||||
<?php $cat_url = (isset($_GET['category']))? "&category=".$_GET['category'] : "" ?>
|
||||
<th class="<?php echo "$css_sort $order" ?>" style="width:120px;">
|
||||
<a href="admin.php?page=catablog&sort=title<?php echo $sort_url . $cat_url ?>">
|
||||
<span><?php _e("Title", "catablog"); ?></span>
|
||||
<span class="sorting-indicator"> </span>
|
||||
</a>
|
||||
</th>
|
||||
|
||||
|
||||
<th class="column-description <?php echo $description_col_class ?>"><?php _e("Description", "catablog"); ?></th>
|
||||
<th class="column-link <?php echo $link_col_class ?>"><?php _e("Link", "catablog"); ?></th>
|
||||
<th class="column-price <?php echo $price_col_class ?>"><?php _e("Price", "catablog"); ?></th>
|
||||
<th class="column-product_code <?php echo $product_code_col_class ?>"><?php _e("Product Code", "catablog"); ?></th>
|
||||
|
||||
<th class="column-categories <?php echo $categories_col_class ?>"><?php _e("Categories", "catablog"); ?></th>
|
||||
<?php $css_sort = ($sort=='menu_order')? "sorted" : "sortable" ?>
|
||||
<?php $sort_url = ($order=='asc')? "&order=desc" : "&order=asc" ?>
|
||||
<?php $cat_url = (isset($_GET['category']))? "&category=".$_GET['category'] : "" ?>
|
||||
<th class="column-order <?php echo "$css_sort $order" ?> <?php echo $order_col_class ?>" style="width:80px;">
|
||||
<a href="admin.php?page=catablog&sort=menu_order<?php echo $sort_url . $cat_url ?>">
|
||||
<span><?php _e("Order", "catablog"); ?></span>
|
||||
<span class="sorting-indicator"> </span>
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<?php $css_sort = ($sort=='date')? "sorted" : "sortable" ?>
|
||||
<?php $sort_url = ($order=='asc')? "&order=desc" : "&order=asc" ?>
|
||||
<?php $cat_url = (isset($_GET['category']))? "&category=".$_GET['category'] : "" ?>
|
||||
<th class="column-date <?php echo "$css_sort $order" ?> <?php echo $date_col_class ?>" style="width:100px;">
|
||||
<a href="admin.php?page=catablog&sort=date<?php echo $sort_url . $cat_url ?>">
|
||||
<span><?php _e("Date", "catablog"); ?></span>
|
||||
<span class="sorting-indicator"> </span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="column-cb check-column"><input type="checkbox" /></th>
|
||||
<th class="cb_icon_column"><?php _e("Image", "catablog"); ?></th>
|
||||
<th class=""><?php _e("Title", "catablog"); ?></th>
|
||||
|
||||
<th class="column-description <?php echo $description_col_class ?>"><?php _e("Description", "catablog"); ?></th>
|
||||
<th class="column-link <?php echo $link_col_class ?>"><?php _e("Link", "catablog"); ?></th>
|
||||
<th class="column-price <?php echo $price_col_class ?>"><?php _e("Price", "catablog"); ?></th>
|
||||
<th class="column-product_code <?php echo $product_code_col_class ?>"><?php _e("Product Code", "catablog"); ?></th>
|
||||
|
||||
<th class="column-categories <?php echo $categories_col_class ?>"><?php _e("Categories", "catablog"); ?></th>
|
||||
<th class="column-order <?php echo $order_col_class ?>"><?php _e("Order", "catablog"); ?></th>
|
||||
<th class="column-date <?php echo $date_col_class ?>"><?php _e("Date", "catablog"); ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="catablog_items">
|
||||
|
||||
<?php if (count($results) < 1): ?>
|
||||
<tr>
|
||||
<td colspan='8'><p>
|
||||
<p><?php _e("No catalog items found", 'catablog'); ?></p>
|
||||
|
||||
<?php if ($selected_term !== false): ?>
|
||||
<p><?php _e("Use the category drop down above to switch category views.", 'catablog'); ?></p>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($results as $result): ?>
|
||||
<?php $edit = 'admin.php?page=catablog&id='.$result->getId() ?>
|
||||
<?php $remove = wp_nonce_url(('admin.php?page=catablog-delete&id='.$result->getId()), "catablog-delete") ?>
|
||||
|
||||
<tr>
|
||||
<th class="check-column">
|
||||
<input type="checkbox" class="bulk_selection" name="bulk_action_id" value="<?php echo $result->getId() ?>" />
|
||||
</th>
|
||||
<td class="cb_icon_column">
|
||||
<a href="<?php echo $edit ?>"><img src="<?php echo $this->urls['thumbnails'] . "/" . $result->getImage() ?>" class="cb_item_icon" width="50" height="50" alt="" /></a>
|
||||
</td>
|
||||
<td>
|
||||
<strong><a href="<?php echo $edit ?>" title="Edit CataBlog Item"><?php echo ($result->getTitle()) ?></a></strong>
|
||||
<div class="row-actions">
|
||||
<span><a href="<?php echo $edit ?>"><?php _e("Edit", "catablog"); ?></a></span>
|
||||
<span> | </span>
|
||||
<span class="trash"><a href="<?php echo $remove ?>" class="remove_link"><?php _e("Delete", "catablog"); ?></a></span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="column-description <?php echo $description_col_class ?>"><?php echo $result->getDescriptionSummary() ?></td>
|
||||
<td class="column-link <?php echo $link_col_class ?>"><?php echo $result->getLink() ?></td>
|
||||
<td class="column-price <?php echo $price_col_class ?>"><?php echo $result->getPrice() ?></td>
|
||||
<td class="column-product_code <?php echo $product_code_col_class ?>"><?php echo $result->getProductCode() ?></td>
|
||||
|
||||
<td class="column-categories <?php echo $categories_col_class ?>"><?php echo implode(', ', $result->getCategories())?></td>
|
||||
|
||||
<td class="column-order <?php echo $order_col_class ?>"> <?php echo htmlspecialchars($result->getOrder(), ENT_QUOTES, 'UTF-8') ?></td>
|
||||
|
||||
<td class="column-date <?php echo $date_col_class ?>">
|
||||
<span><?php echo str_replace('-', '/', substr($result->getDate(), 0, 10)) ?></span>
|
||||
<br />
|
||||
<span><?php echo substr($result->getDate(), 11) ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
202
src/wp-content/plugins/catablog/templates/admin-new.php
Normal file
@ -0,0 +1,202 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("Add New CataBlog Entry", "catablog") ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<form id="catablog-create" class="catablog-form clear_float" method="post" action="admin.php?page=catablog-create" enctype="multipart/form-data">
|
||||
|
||||
<div id="upload-form-left-col">
|
||||
|
||||
<div id="dynamic_title">
|
||||
<h3><strong><?php _e("Upload An Image To Create A New Catalog Item", "catablog"); ?></strong></h3>
|
||||
<h3 class="hide"><strong><?php _e("Upload Multiple Images", "catablog"); ?></strong></h3>
|
||||
</div>
|
||||
|
||||
<div id="select_images_form">
|
||||
<div id="upload_buttons">
|
||||
<input type="file" id="new_image" name="new_image" />
|
||||
<?php wp_nonce_field( 'catablog_create', '_catablog_create_nonce', false, true ) ?>
|
||||
<input type="submit" name="save" value="<?php _e("Upload", "catablog") ?>" class="button-primary" />
|
||||
<p class="error"><?php _e("Flash upload was not enabled because either JavaScript is disabled or your version of Flash is too old.", "catablog")?></p>
|
||||
</div>
|
||||
|
||||
<p><?php printf(__("Maximum upload file size: %sB", "catablog"), ini_get('upload_max_filesize')); ?></p>
|
||||
|
||||
<p><small>
|
||||
<?php _e("Select images on your computer to upload and make new catalog items with.", "catablog"); ?><br />
|
||||
<?php _e("You may upload JPEG, GIF and PNG graphic formats only.", "catablog"); ?><br />
|
||||
<strong><?php _e("No animated GIFs please.", "catablog"); ?></strong>
|
||||
</small></p>
|
||||
</div>
|
||||
<?php /*
|
||||
<h3><strong><?php _e("Choose Categories","catablog") ?></strong></h3>
|
||||
<ul id="catablog-category-checklist" class="list:category categorychecklist form-no-clear">
|
||||
|
||||
<?php $categories = $this->get_terms() ?>
|
||||
<?php $result = new CataBlogItem() ?>
|
||||
<?php ?>
|
||||
|
||||
<?php if (count($categories) < 1): ?>
|
||||
<li><span><?php _e("You currently have no categories.", 'catablog'); ?></span></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<li>
|
||||
<label class="catablog-category-row">
|
||||
<?php $checked = (in_array($category->term_id, array_keys($result->getCategories())))? 'checked="checked"' : '' ?>
|
||||
<input id="in-category-<?php echo $category->term_id ?>" type="checkbox" <?php echo $checked ?> name="categories[]" value="<?php echo $category->term_id ?>" />
|
||||
<?php $default_term = $this->get_default_term() ?>
|
||||
<?php if ($category->name != $default_term->name): ?>
|
||||
<a href="#delete" class="catablog-category-delete hide"><small><?php _e("[DELETE]", 'catablog'); ?></small></a>
|
||||
<?php endif ?>
|
||||
<span><?php echo $category->name ?></span>
|
||||
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<p><small><?php _e("Check the categories you wish all new catalog items to be put into.", "catablog") ?></small></p>
|
||||
*/ ?>
|
||||
</div>
|
||||
|
||||
<div id="upload-form-right-col" class="hide">
|
||||
<div id="upload-feedback">
|
||||
<p><?php printf(__('currently uploading %s of %s', 'catablog'), '<strong id="current_number"></strong>', '<strong id="total_number"></strong>') ?></p>
|
||||
<div id="catablog-progress-current-upload" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<small class="catablog-progress-text"> </small>
|
||||
</div>
|
||||
<div id="catablog-progress-all-uploads" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<small class="catablog-progress-text"> </small>
|
||||
</div>
|
||||
</div>
|
||||
<ul id="new-items-editor"></ul>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
flash_version = swfobject.getFlashPlayerVersion();
|
||||
if (flash_version.major < 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
swfu = new SWFUpload({
|
||||
upload_url : "<?php echo $this->urls['plugin'] . '/lib/catablog.upload.php' ?>",
|
||||
flash_url : "<?php echo get_bloginfo('url') . '/wp-includes/js/swfupload/swfupload.swf' ?>",
|
||||
|
||||
file_types : "*.jpg;*.jpeg;*.gif;*.png",
|
||||
file_type_description: "Web Image Files",
|
||||
file_size_limit : "<?php printf('%sB', ini_get('upload_max_filesize')) ?>",
|
||||
|
||||
button_placeholder_id : 'upload_buttons',
|
||||
button_image_url : "<?php echo $this->urls['images'] ?>/upload.png?v=<?php echo $this->version ?>",
|
||||
button_width : 190,
|
||||
button_height: 23,
|
||||
button_text : '<span class="theFont"><?php _e("Select Images", "catablog") ?></span>',
|
||||
button_text_style : ".theFont {font-size:12px; font-family:sans-serif;}",
|
||||
button_text_top_padding: 2,
|
||||
button_text_left_padding: 10,
|
||||
button_cursor: SWFUpload.CURSOR.HAND,
|
||||
|
||||
post_params : {
|
||||
"auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>",
|
||||
"logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
|
||||
"_wpnonce" : "<?php echo wp_create_nonce('catablog_swfupload'); ?>",
|
||||
"categories" : [],
|
||||
},
|
||||
|
||||
swfupload_loaded_handler : catablog_swfupload_loaded,
|
||||
|
||||
file_dialog_complete_handler : catablog_swfupload_file_dialog_complete,
|
||||
|
||||
file_queued_handler : catablog_swfupload_file_queued,
|
||||
file_queued_error_handler : catablog_swfupload_file_queued_error,
|
||||
upload_start_handler : catablog_swfupload_upload_start,
|
||||
upload_progress_handler : catablog_swfupload_upload_progress,
|
||||
upload_error_handler : catablog_swfupload_upload_error,
|
||||
upload_success_handler : catablog_swfupload_upload_success,
|
||||
upload_complete_handler : catablog_swfupload_upload_complete,
|
||||
});
|
||||
|
||||
var to_show = jQuery('#dynamic_title h3:hidden');
|
||||
var to_hide = jQuery('#dynamic_title h3:visible');
|
||||
|
||||
to_show.show();
|
||||
to_hide.hide();
|
||||
|
||||
jQuery('#upload-form-left-col').addClass('left-col');
|
||||
jQuery('#upload-form-right-col').addClass('right-col');
|
||||
|
||||
<?php /*
|
||||
var cancel_button = '<input id="cancel-upload" type="button" disabled="disabled" value="<?php _e("Cancel Upload", "catablog") ?>" class="button">';
|
||||
jQuery('.swfupload').after(cancel_button);
|
||||
jQuery('#cancel-upload').bind('click', function(event) {
|
||||
if (jQuery(this).attr('disabled')) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
*/ ?>
|
||||
});
|
||||
|
||||
function catablog_micro_save(event) {
|
||||
if (event.type == "keypress") {
|
||||
var key_code = (event.keyCode ? event.keyCode : event.which);
|
||||
if (key_code != 13) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.disabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var container = jQuery(this).closest('li');
|
||||
var button = container.find('input.button-primary');
|
||||
var title = container.find('input.title').val();
|
||||
var description = container.find('textarea.description').val();
|
||||
var item_id = container.find('input.id').val();
|
||||
|
||||
container.find('input').attr('readonly', true);
|
||||
container.find('textarea').attr('readonly', true);
|
||||
|
||||
button.attr('disabled', true);
|
||||
button.addClass('button button-disabled').removeClass('button-primary');
|
||||
button.after('<span class="ajax-save"> </span>');
|
||||
|
||||
var params = {
|
||||
'action': 'catablog_micro_save',
|
||||
'security': '<?php echo wp_create_nonce("catablog-micro-save") ?>',
|
||||
'id' : item_id,
|
||||
'title' : title,
|
||||
'description': description
|
||||
}
|
||||
|
||||
jQuery.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.message);
|
||||
}
|
||||
|
||||
container.next('li').find('input.title').focus().select();
|
||||
container.hide(800, function() {
|
||||
jQuery(this).remove();
|
||||
});
|
||||
}
|
||||
catch(error) {
|
||||
alert(error);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
740
src/wp-content/plugins/catablog/templates/admin-options.php
Normal file
@ -0,0 +1,740 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("CataBlog Options", "catablog"); ?></h2>
|
||||
|
||||
<noscript>
|
||||
<div class="error">
|
||||
<strong><?php _e("You must have a JavaScript enabled browser to change the CataBlog options.", "catablog"); ?></strong>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<?php if ($recalculate_thumbnails): ?>
|
||||
<div id="catablog-progress-thumbnail" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Processing Thumbnail Images...", "catablog"); ?></h3>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($recalculate_fullsize): ?>
|
||||
<div id="catablog-progress-fullsize" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Waiting For LightBox Rendering To Finish...", "catablog"); ?></h3>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<form action="admin.php?page=catablog-options" id="catablog-options" class="catablog-form" method="post">
|
||||
|
||||
<ul id="catablog-options-menu">
|
||||
<li><a href="#thumbnails" title="Set size and how thumbnails will be made"><?php _e("Thumbnails", "catablog"); ?></a></li>
|
||||
<li><a href="#lightbox" title=""><?php _e("LightBox", "catablog"); ?></a></li>
|
||||
<li><a href="#public" title=""><?php _e("Public", "catablog"); ?></a></li>
|
||||
<li><a href="#title" title=""><?php _e("Title", "catablog"); ?></a></li>
|
||||
<li><a href="#description" title=""><?php _e("Description", "catablog"); ?></a></li>
|
||||
<li><a href="#template" title="Control how your catalog is rendered"><?php _e("Template", "catablog"); ?></a></li>
|
||||
<li><a href="#store" title=""><?php _e("Store", "catablog"); ?></a></li>
|
||||
<li><a id="catablog-options-menu-export" href="#export" title=""><?php _e("Export", "catablog"); ?></a></li>
|
||||
<li><a href="#import" title=""><?php _e("Import", "catablog"); ?></a></li>
|
||||
<li><a id="catablog-options-menu-system" href="#system" title=""><?php _e("Systems", "catablog"); ?></a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<?php /* THUMBNAIL SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-thumbnails" class="catablog-options-panel">
|
||||
<p>
|
||||
<label for='thumbnail_size'><?php _e("Thumbnail Size:", "catablog"); ?></label>
|
||||
<input type='text' name='thumbnail_size' id='thumbnail_size' class='integer_field' size='5' value='<?php echo $thumbnail_size ?>' />
|
||||
<span><?php _e("pixels", "catablog"); ?></span><br />
|
||||
|
||||
<small class="error hidden"><?php _e("Your thumbnail size must be a positive integer.", "catablog"); ?><br /></small>
|
||||
<small><?php _e("this will change the thumbnail size of all your catalog items.", "catablog"); ?></small>
|
||||
</p>
|
||||
<p>
|
||||
<?php $checked = ($keep_aspect_ratio)? "checked='checked'" : "" ?>
|
||||
<label for="keep_aspect_ratio"><?php _e("Keep Aspect Ratio:", "catablog"); ?></label>
|
||||
<input type="checkbox" name="keep_aspect_ratio" id="keep_aspect_ratio" <?php echo $checked ?> />
|
||||
<br />
|
||||
<small><?php _e("this will keep the aspect ratio of the original image in your thumbnails, using the background color to fill in the empty space.", "catablog"); ?></small>
|
||||
</p>
|
||||
<p>
|
||||
<label><?php _e("Thumbnail Background Color:", "catablog"); ?></label>
|
||||
<input type="text" name="bg_color" id="bg_color" size="8" maxlength="7" value="<?php echo $background_color ?>" />
|
||||
<span class="color-swatch hide-if-no-js"> </span>
|
||||
<small><a class="hide-if-no-js" href="#" id="pickcolor"><?php _e('Select a Color', 'catablog'); ?></a></small>
|
||||
</p>
|
||||
<div id="color-picker-div"> </div>
|
||||
<hr />
|
||||
<div>
|
||||
<label><?php _e("Thumbnail Preview", "catablog"); ?></label>
|
||||
<p id="thumbnail_preview">
|
||||
<span id='demo_box' class='demo_box' style='width:<?php echo $thumbnail_size ?>px; height:<?php echo $thumbnail_size ?>px;'> </span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php /* LIGHTBOX SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-lightbox" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<?php $checked = ($lightbox_enabled)? "checked='checked'" : "" ?>
|
||||
<label for="lightbox_enabled"><?php _e("Enable LightBox:", "catablog"); ?></label>
|
||||
<input type="checkbox" name="lightbox_enabled" id="lightbox_enabled" <?php echo $checked ?> /><br/>
|
||||
<small><?php _e("Load the necessary javascript libraries to enlarge an image thumbnail with the LightBox effect.", "catablog"); ?></small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php $checked = ($lightbox_render)? "checked='checked'" : "" ?>
|
||||
<label for="lightbox_render"><?php _e("Render a new image to be used for the lightbox:", "catablog"); ?></label>
|
||||
<input type="checkbox" name="lightbox_render" id="lightbox_render" <?php echo $checked ?> /><br />
|
||||
<small><?php _e("check this box to render a similarly sized image for each catalog item to be used with the LightBox.", "catablog")?></small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for='lightbox_image_size'><?php _e("LightBox Size:", "catablog"); ?></label>
|
||||
<input type='text' name='lightbox_image_size' id='lightbox_image_size' class='integer_field' size='5' value='<?php echo $lightbox_size ?>' />
|
||||
<span><?php _e("pixels", "catablog"); ?></span><br />
|
||||
<small class="error hidden"><?php _e("Your lightbox size must be a positive integer.", "catablog"); ?><br /></small>
|
||||
<small><?php _e("This is the maximum length of either the height or width, depending on whichever is longer in the original uploaded image.", "catablog") ?></small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for='lightbox_selector'><?php _e("LightBox jQuery Selector:", "catablog"); ?></label>
|
||||
<input type='text' name='lightbox_selector' id='lightbox_selector' class='' size='50' value='<?php echo $lightbox_selector ?>' />
|
||||
<br />
|
||||
<small><?php _e("This lets you modify the selector used by jQuery to attach the LightBox to image thumbnails. The default value is: .catablog-image", "catablog") ?></small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php /* PUBLIC SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-public" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<?php $checked = ($public_posts_enabled)? "checked='checked'" : "" ?>
|
||||
<label for="public_posts"><?php _e("Enable Individual Pages and Category Archives:", "catablog"); ?></label>
|
||||
<input type="checkbox" name="public_posts" id="public_posts" <?php echo $checked ?> /><br/>
|
||||
<small><?php _e("If this is checked, each and every catalog item will get its very own page, complete with permalink.", "catablog") ?></small><br />
|
||||
<small><?php _e("Also, each CataBlog Category will have their own archive page automatically generated.", "catablog") ?></small><br />
|
||||
<small><?php printf(__("These CataBlog Category pages can easily be added to your %sMenus%s with the Screen Options panel.", "catablog"), "<a href='nav-menus.php#screen-options'>", '</a>') ?></small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for='public_post_slug'><?php _e("Individual Pages Slug:", "catablog"); ?></label>
|
||||
<input type='text' name='public_post_slug' id='public_post_slug' size='20' value='<?php echo $public_posts_slug ?>' /><br />
|
||||
<small><?php _e("This is the identifying slug your blog will use to create your individual catalog item pages.", "catablog"); ?></small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for='public_tax_slug'><?php _e("Category Pages Slug:", "catablog"); ?></label>
|
||||
<input type='text' name='public_tax_slug' id='public_tax_slug' size='20' value='<?php echo $public_tax_slug ?>' /><br />
|
||||
<small><?php _e("This is the identifying slug your blog will use to create your catalog archive pages.", "catablog") ?></small>
|
||||
</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p>
|
||||
<strong class="warning"><?php _e('Catalog Slugs Warning', 'catablog')?></strong><br />
|
||||
<small><?php printf(__('Please make sure you do not set either of your catalog slugs to a %sWordPress Reserved Term%s.', 'catablog'), '<a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms" target="_blank">', '</a>') ?></small><br />
|
||||
<small><?php _e("These labels must also be URL friendly, so they may be transformed from your original input.", 'catablog') ?></small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong class="warning"><?php _e('Changing Catalog Slugs', 'catablog')?></strong><br />
|
||||
<small><?php printf(__('If you change these values, please immediately visit the %sPermalinks%s panel to update your rewrite rules.', 'catablog'), '<a href="options-permalink.php">', '</a>') ?></small><br />
|
||||
<small><?php _e("Your individual catalog item pages and archives will not work until you have updated your rewrite rules.", 'catablog') ?></small>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php /* TITLE SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-title" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<label for="link_target"><?php _e("Link Target:", "catablog"); ?></label>
|
||||
<input type="text" id="link_target" name="link_target" value="<?php echo $link_target ?>" /><br />
|
||||
<small>
|
||||
<?php _e("The link target setting will set the <strong>target</strong> attribute of all the catalog title links.", "catablog"); ?><br />
|
||||
<strong><?php _e("examples:", "catablog"); ?></strong> _blank, _top, _self.
|
||||
</small>
|
||||
</p>
|
||||
<p>
|
||||
<label for="link_target"><?php _e("Link Relationship:", "catablog"); ?></label>
|
||||
<input type="text" id="link_relationship" name="link_relationship" value="<?php echo $link_relationship ?>" maxlength="30" /><br />
|
||||
<small>
|
||||
<?php _e("The link relationship will set the <strong>rel</strong> attribute of all the catalog title links.", "catablog"); ?><br />
|
||||
<strong><?php _e("examples:", "catablog"); ?></strong> index, next, prev, glossary, chapter, bookmark, nofollow.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<?php /* DESCRIPTION SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-description" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<?php $checked = ($wp_filters_enabled)? "checked='checked'" : "" ?>
|
||||
<label for="catablog-filters-enabled"><?php _e("Enable WordPress Filters:", "catablog"); ?></label>
|
||||
<input type="checkbox" name="wp-filters-enabled" id="catablog-filters-enabled" <?php echo $checked ?> /><br/>
|
||||
<small>
|
||||
<?php _e("Enable the standard WordPress filters for your catalog item's description.", "catablog"); ?><br />
|
||||
<?php _e("This allows you to use ShortCodes and media embeds inside your catalog item descriptions.", "catablog"); ?><br />
|
||||
<?php _e("Please <strong>do not use the CataBlog ShortCode</strong> inside a catalog item's description.", "catablog"); ?>
|
||||
</small>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php $checked = ($nl2br_enabled)? "checked='checked'" : "" ?>
|
||||
<label for="catablog-nl2br-enabled"><?php _e("Render Line Breaks:", "catablog"); ?></label>
|
||||
<input type="checkbox" name="nl2br-enabled" id="catablog-nl2br-enabled" <?php echo $checked ?> /><br/>
|
||||
<small>
|
||||
<?php printf(__("Filter your catalog item's description through the standard PHP function %s.", "catablog"), '<a href="http://php.net/manual/en/function.nl2br.php" target="_blank">nl2br()</a>'); ?><br />
|
||||
<?php _e("This will insert HTML line breaks before all new lines in your catalog descriptions.", "catablog"); ?><br />
|
||||
<?php _e("Turn this off if unwanted line breaks are being rendered on your page.", "catablog"); ?>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php /* TEMPLATE SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-template" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<?php $views = new CataBlogDirectory($this->directories['views']); ?>
|
||||
<?php if ($views->isDirectory()): ?>
|
||||
<select id="catablog-template-view-menu">
|
||||
<?php foreach($views->getFileArray() as $key => $view): ?>
|
||||
<?php echo "<option value='$view'>$view</option>"; ?>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<a href="<?php echo $this->urls['views'] ?>" id="catablog-view-set-template" class="catablog-load-code button add-new-h2"><?php _e("Load Template", "catablog"); ?></a>
|
||||
<?php else: ?>
|
||||
<p class="error"><?php _e("Could not locate the views directory. Please reinstall CataBlog.", "catablog"); ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="view-code-template" id="catablog-view-set-template-code" class="catablog-code" rows="10" cols="30"><?php echo $this->options['view-theme'] ?></textarea>
|
||||
|
||||
<small>
|
||||
<?php _e("You may change the html code rendered by <strong>CataBlog</strong> here, this allows you to make fundamental changes to how catalogs will appear in your posts. You may choose a template from the drop down menu at top and then click <em>Load Template</em> to load it into the template code. If you want to setup a photo gallery I would recommend that you load the <em>Gallery template</em> and then click save below. To setup a shopping cart you should load the <em>Default Template</em> code and then load a Store Template.", "catablog"); ?>
|
||||
</small>
|
||||
</p>
|
||||
|
||||
<p><small>
|
||||
<?php _e("Don't forget to click <strong>Save Changes</strong> at the bottom of the page to finalize your changes and use the new code for your blog.", "catablog"); ?>
|
||||
</small></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php /* BUY NOW TEMPLATE SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-store" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<label for="paypal_email"><?php _e("PayPal Account Email Address:", "catablog"); ?></label>
|
||||
<input type="text" name="paypal_email" id="paypal_email" size="50" value="<?php echo $paypal_email ?>" />
|
||||
</p>
|
||||
|
||||
<p><small>
|
||||
<?php printf(__("Enter in an email address here that has been registered with %sPayPal%s and choose a <em>Buy Now Template</em> below to setup a store. You may then give items a price and product code. When an item has a price above zero a 'Buy Now' button will appear under the description of that CataBlog item.", "catablog"), '<a href="http://www.paypal.com" target="_blank">', '</a>'); ?>
|
||||
</small></p>
|
||||
|
||||
<hr />
|
||||
|
||||
<p>
|
||||
<?php $views = new CataBlogDirectory($this->directories['buttons']) ?>
|
||||
<?php if ($views->isDirectory()): ?>
|
||||
<select id="catablog-template-store-menu">
|
||||
<?php foreach($views->getFileArray() as $key => $view): ?>
|
||||
<?php echo "<option value='$view'>$view</option>" ?>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<a href="<?php echo $this->urls['buttons'] ?>" id="catablog-view-set-buynow" class="catablog-load-code button add-new-h2"><?php _e("Load Template", "catablog"); ?></a>
|
||||
<?php else: ?>
|
||||
<p class="error"><?php _e("Could not locate the views directory. Please reinstall CataBlog.", "catablog"); ?></p>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="view-code-buynow" id="catablog-view-set-buynow-code" class="catablog-code" rows="10" cols="30"><?php echo $this->options['view-buynow'] ?></textarea>
|
||||
<small>
|
||||
<?php _e("You may change the html code rendered for the <strong>Buy Now</strong> button here. All value tokens are available here too, so place the title, description or any other values you may want to use from the current catalog item in this code as well.", "catablog"); ?>
|
||||
</small>
|
||||
</p>
|
||||
<p style="clear:both;"> </p>
|
||||
|
||||
<input type="hidden" name="save" id="save" value="yes" />
|
||||
<?php wp_nonce_field( 'catablog_options', '_catablog_options_nonce', false, true ) ?>
|
||||
<input id="catablog-options-submit" type="submit" class="hide" value="<?php _e('Save Changes') ?>" />
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php /* EXPORT SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-export" class="catablog-options-panel hide">
|
||||
<?php $function_exists = function_exists('fputcsv') ?>
|
||||
|
||||
<p><?php _e("You may export your CataBlog data to a XML or CSV file which may be used to backup and protect your work. The XML or CSV file is a simple transfer of the database information itself and the <strong>images are not included in this backup</strong>. To backup your images follow the directions at the bottom of the page.", "catablog"); ?></p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-export&format=xml', 'catablog-export') ?>
|
||||
<a href="<?php echo $link ?>" class="button"><?php _e("Save XML BackUp File", "catablog"); ?></a>
|
||||
<?php if ($function_exists): ?>
|
||||
<span> | </span>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-export&format=csv', 'catablog-export') ?>
|
||||
<a href="<?php echo $link ?>" class="button"><?php _e("Save CSV BackUp File", "catablog"); ?></a>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
|
||||
|
||||
<?php if (!$function_exists): ?>
|
||||
<p class="error"><small>
|
||||
<?php printf(__("You must have the function %sfputcsv()%s available on your web server's version of PHP for CSV export to work.", "catablog"), '<strong><a href="http://php.net/manual/en/function.fputcsv.php" target="_blank">', '</a></strong>'); ?>
|
||||
<br />
|
||||
<?php _e("Please contact your server administrator for more information regarding this error.", "catablog"); ?>
|
||||
</small></p>
|
||||
<?php else: ?>
|
||||
<p> </p>
|
||||
<?php endif ?>
|
||||
|
||||
<p>
|
||||
<strong><?php _e("Backing Up Images:", "catablog"); ?></strong><br />
|
||||
<?php _e("Please copy the <em>catablog</em> directory to a secure location.", "catablog"); ?><br />
|
||||
<?php _e("The directory for this WordPress blog can be located on your web server at:", "catablog"); ?><br />
|
||||
<small><em><?php echo $this->directories['uploads'] ?></em></small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php /* IMPORT SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-import" class="catablog-options-panel hide">
|
||||
<label><?php _e("Import XML/CSV Data", "catablog"); ?></label>
|
||||
<form action="admin.php?page=catablog-import" method="post" enctype="multipart/form-data">
|
||||
<?php $function_exists = function_exists('simplexml_load_file') ?>
|
||||
|
||||
<p><input type="file" name="catablog_data" id="catablog_data" /></p><br />
|
||||
|
||||
<p style="margin-bottom:5px;">
|
||||
<input type="checkbox" id="catablog_clear_db" name="catablog_clear_db" value="true" />
|
||||
<label for="catablog_clear_db"><?php _e("Replace All Data:", "catablog"); ?></label>
|
||||
</p>
|
||||
|
||||
<p><input type="submit" class="button" value="<?php _e('Import CataBlog Data', "catablog") ?>" /></p>
|
||||
|
||||
<?php if (!$function_exists): ?>
|
||||
<p class="error"><small>
|
||||
<?php _e("You must have the <strong>Simple XML Library</strong> installed on your web server's version of PHP for XML imports to work. Please contact your server administrator for more information regarding this error.", "catablog"); ?>
|
||||
</small></p>
|
||||
<?php endif ?>
|
||||
|
||||
<p><small>
|
||||
<?php _e("To import data into your catalog you simply select a XML or CVS file on your hard drive and click the <em>Import CataBlog Data</em> button. You may choose to completely erase all your data before importing by checking the <em>Replace All Data</em> checkbox.<br />Keep in mind, this <strong>does not import or delete images</strong>.", "catablog"); ?>
|
||||
</small></p>
|
||||
<p><small>
|
||||
<?php printf(__("To import images you should upload them to the <em>originals</em> directory, located at: <em>%s</em>. Once you load the XML or CVS file and the images into the <em>originals</em> directory everything should be set after you %sRegenerate All Images%s in the systems tab.", "catablog"), $this->directories['originals'], '<a href="admin.php?page=catablog-regenerate-images" class="js-warn">', '</a>'); ?>
|
||||
</small></p>
|
||||
|
||||
<p><small>
|
||||
<?php printf(__("You may view XML and CSV examples in the %simport/export documentation%s.", "catablog"), '<a href="http://catablog.illproductions.com/documentation/importing-and-exporting-catalogs/" target="_blank">', '</a>'); ?>
|
||||
</small></p>
|
||||
|
||||
<?php wp_nonce_field( 'catablog_import', '_catablog_import_nonce', false, true ) ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php /* SYSTEM SETTINGS PANEL */ ?>
|
||||
<div id="catablog-options-system" class="catablog-options-panel hide">
|
||||
<p>
|
||||
<?php $permissions = substr(sprintf('%o', fileperms($this->directories['uploads'])), -4) ?>
|
||||
<?php if ($permissions == '0777'): ?>
|
||||
<span><?php _e("CataBlog Upload Folders are <strong>Unlocked</strong>", "catablog"); ?></span>
|
||||
<?php elseif ($permissions == '0755'): ?>
|
||||
<span><?php _e("CataBlog Upload Folders are <strong>Locked</strong>", "catablog"); ?></span>
|
||||
<?php else: ?>
|
||||
<span><?php _e("Could not lock/unlock the directory. Are you using a unix based server?", "catablog"); ?></span>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-lock-folders#system', 'catablog-lock-folders') ?>
|
||||
<a href="<?php echo $link ?>" class="button"><?php _e("Lock Folders", "catablog"); ?></a>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-unlock-folders#system', 'catablog-unlock-folders') ?>
|
||||
<a href="<?php echo $link ?>" class="button"><?php _e("Unlock Folders", "catablog"); ?></a>
|
||||
</p>
|
||||
|
||||
<p><small>
|
||||
<?php printf(__("You may lock and unlock your <em>catablog</em> folders with these controls. The idea is to unlock the folders, use your FTP client to upload your original files and then lock the folders to protect them from hackers. After unlocking your directories please upload the original files directly into the <strong>%s</strong> folder without replacing it. <strong>Do not replace any of the CataBlog created folders</strong>. You should then regenerate all your thumbnail and lightbox pictures below. These controls may not work on a Windows server, it depends on your servers PHP settings and if the chmod command is supported.", "catablog"), $this->directories['originals']); ?>
|
||||
</small></p>
|
||||
|
||||
<hr />
|
||||
|
||||
<p><label><?php _e("Rescan Original Image Folder", "catablog"); ?></label></p>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-rescan-images', 'catablog-rescan-originals') ?>
|
||||
<p><a href="<?php echo $link ?>" class="button js-warn"><?php _e("Rescan Original Images Folder Now", "catablog"); ?></a></p>
|
||||
<p><small>
|
||||
<?php _e("Click the <em>Rescan Now</em> button to rescan the original catablog images folder and automatically import any new jpeg, gif or png images. It works simply by making a list of all the image names in the database and then compares each file's name in the originals folder against the list of image names in the database. Any newly discovered images will automatically be made into a new catalog item. You should Regenerate Images after running this command.", "catablog"); ?>
|
||||
</small></p>
|
||||
|
||||
<hr />
|
||||
|
||||
<p><label><?php _e("Regenerate Images", "catablog"); ?></label></p>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-regenerate-images', 'catablog-regenerate-images') ?>
|
||||
<p><a href="<?php echo $link ?>" class="button js-warn"><?php _e("Regenerate All Images Now", "catablog"); ?></a></p>
|
||||
<p><small>
|
||||
<?php _e("Click the <em>Regenerate Now</em> button to recreate all the thumbnail and lightbox images that CataBlog has generated over the time you have used it. This is also useful when restoring exported data from another version of CataBlog. after you have uploaded your original images you must regenerate your images so they display properly.", "catablog"); ?>
|
||||
</small></p>
|
||||
|
||||
<hr />
|
||||
|
||||
<p><label><?php _e("Remove CataBlog", "catablog"); ?></label></p>
|
||||
<?php $link = wp_nonce_url('admin.php?page=catablog-remove', 'catablog-remove') ?>
|
||||
<p><a href="<?php echo $link ?>" class="button js-warn" id="button-reset"><?php _e("Remove All CataBlog Data", "catablog"); ?></a></p>
|
||||
<p><small>
|
||||
<?php _e("Delete your entire catalog, deleting all photos and custom data permanently. Sometimes you can use this to fix an improper installation.", "catablog"); ?>
|
||||
</small></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php /* SUBMIT FORM BUTTON */ ?>
|
||||
<p class="submit" style="margin-left:100px;">
|
||||
<input type="button" id="save_changes" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
||||
<span><?php printf(__('or %sundo current changes%s', 'catablog'), '<a href="admin.php?page=catablog-options">', '</a>'); ?></span>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
/****************************************
|
||||
** BIND SAVE CHANGES BUTTON
|
||||
****************************************/
|
||||
$('#save_changes').bind('click', function(event) {
|
||||
var form_action = $('#catablog-options').attr('action');
|
||||
var active_tab = $('#catablog-options-menu li a.selected').attr('href');
|
||||
|
||||
$('#catablog-options').attr('action', (form_action+active_tab))
|
||||
$('#catablog-options').submit();
|
||||
});
|
||||
|
||||
|
||||
/****************************************
|
||||
** BIND OPTION PANEL TABS AND CLICK ONE
|
||||
****************************************/
|
||||
$('#catablog-options-menu li a').bind('click', function(event) {
|
||||
$('.catablog-options-panel:visible').hide();
|
||||
$('#catablog-options-menu li a.selected').removeClass('selected');
|
||||
|
||||
$(this).addClass('selected');
|
||||
var panel = '#catablog-options-' + $(this).attr('href').substring(1);
|
||||
$(panel).show();
|
||||
});
|
||||
|
||||
var path = '#catablog-options-menu li:first a';
|
||||
var hash = window.location.hash;
|
||||
if (hash.length > 0) {
|
||||
path = '#catablog-options-menu li a[href='+hash+']';
|
||||
}
|
||||
$(path).click();
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** THUMBNAILS PANEL
|
||||
****************************************/
|
||||
// update the thumbnail preview size dynamically
|
||||
$('#thumbnail_size').bind('keyup', function(event) {
|
||||
var v = this.value;
|
||||
if (is_integer(v) && (v > 0)) {
|
||||
$(this).siblings('small.error').hide();
|
||||
if ($(this).attr('id') == 'thumbnail_size') {
|
||||
jQuery('#demo_box').animate({width:(v-1), height:(v-1)}, 100);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// update thumbnail preview for keep aspect ratio option
|
||||
if ($('#keep_aspect_ratio').attr('checked') == false) {
|
||||
$('#demo_box').addClass('crop');
|
||||
}
|
||||
$('#keep_aspect_ratio').bind('change', function(event) {
|
||||
if (this.checked) {
|
||||
$('#demo_box').removeClass('crop');
|
||||
}
|
||||
else {
|
||||
$('#demo_box').addClass('crop');
|
||||
}
|
||||
});
|
||||
|
||||
// load image for thumbnail preview
|
||||
var thumbnail_preview = new Image;
|
||||
thumbnail_preview.onload = function() {
|
||||
var preview = '<img src="'+this.src+'" />';
|
||||
$('#demo_box').append(preview);
|
||||
}
|
||||
thumbnail_preview.src = "<?php echo $this->urls['images'] ?>/catablog-thumbnail-preview.jpg";
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** LIGHTBOX PANEL
|
||||
****************************************/
|
||||
// disable lightbox size field if the lightbox is off
|
||||
$('#lightbox_image_size').attr('readonly', !$('#lightbox_render').attr('checked'));
|
||||
$('#lightbox_render').bind('click', function(event) {
|
||||
if (this.checked) {
|
||||
$('#lightbox_image_size').attr('readonly', false);
|
||||
}
|
||||
else {
|
||||
$('#lightbox_image_size').attr('readonly', true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** PUBLIC PANEL
|
||||
****************************************/
|
||||
$('#public-catalog-slug').attr('readonly', !$('#public-catalog-items').attr('checked'));
|
||||
$('#public-catalog-items').bind('click', function(event) {
|
||||
if (this.checked) {
|
||||
$('#public-catalog-slug').attr('readonly', false);
|
||||
}
|
||||
else {
|
||||
$('#public-catalog-slug').attr('readonly', true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** TEMPLATE & BUY BUTTON PANELS
|
||||
****************************************/
|
||||
// bind the load buttons for the template drop down menus
|
||||
$('.catablog-load-code').bind('click', function(event) {
|
||||
var id = this.id;
|
||||
var selected = $(this).siblings('select').val();
|
||||
var url = this.href + "/" + selected;
|
||||
|
||||
$.get(url, function(data) {
|
||||
$('#' + id + '-code').val(data);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// bind the textareas in the catablog options form to accept tabs
|
||||
$('#catablog-options textarea').bind('keydown', function(event) {
|
||||
var item = this;
|
||||
if(navigator.userAgent.match("Gecko")){
|
||||
c = event.which;
|
||||
}else{
|
||||
c = event.keyCode;
|
||||
}
|
||||
if(c == 9){
|
||||
replaceSelection(item,String.fromCharCode(9));
|
||||
$("#"+item.id).focus();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** GENERAL FORM BINDINGS
|
||||
****************************************/
|
||||
// enter key submits form
|
||||
$('#catablog-options input').bind('keydown', function(event) {
|
||||
if(event.keyCode == 13){
|
||||
$('#save_changes').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// up and down arrow keys for changing integer values
|
||||
$('#catablog-options input.integer_field').bind('keydown', function(event) {
|
||||
var step = 5;
|
||||
var keycode = event.keyCode;
|
||||
|
||||
if (keycode == 40) { this.value = parseInt(this.value) - step; }
|
||||
if (keycode == 38) { this.value = parseInt(this.value) + step; }
|
||||
});
|
||||
|
||||
// bind showing an error message when an integer value is incorrect
|
||||
$('#catablog-options input.integer_field').bind('keyup', function(event) {
|
||||
var v = this.value;
|
||||
|
||||
if (is_integer(v) && (v > 0)) {
|
||||
// do nothing
|
||||
}
|
||||
else {
|
||||
$(this).siblings('small.error').show();
|
||||
}
|
||||
|
||||
possibly_disable_save_button();
|
||||
});
|
||||
|
||||
// confirm with javascript that the user wants to complete the action
|
||||
$('div.catablog-options-panel a.js-warn').click(function(event) {
|
||||
var message = $(this).html() + "?";
|
||||
return confirm(message);
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** BIND COLOR PICKERS
|
||||
****************************************/
|
||||
var farbtastic;
|
||||
function pickColor(a) {
|
||||
farbtastic.setColor(a);
|
||||
jQuery("#bg_color").val(a);
|
||||
jQuery("#demo_box").css("background-color",a)
|
||||
jQuery('.color-swatch').css("background-color",a);
|
||||
}
|
||||
jQuery("#pickcolor").click(function() {
|
||||
|
||||
jQuery(this).addClass('selected');
|
||||
|
||||
var color_picker = jQuery("#color-picker-div");
|
||||
color_picker.css('top', jQuery('#bg_color').offset().top + 21);
|
||||
color_picker.css('left', jQuery(this).offset().left);
|
||||
color_picker.show();
|
||||
|
||||
return false;
|
||||
});
|
||||
jQuery("#bg_color").keyup(function() {
|
||||
var b = jQuery(this).val();
|
||||
a = b;
|
||||
|
||||
if (a[0]!="#") {
|
||||
a = "#"+a;
|
||||
}
|
||||
|
||||
a = a.replace(/[^#a-fA-F0-9]+/,"");
|
||||
if (a != b) {
|
||||
jQuery("#bg_color").val(a)
|
||||
}
|
||||
|
||||
if (a.length == 4 || a.length == 7){
|
||||
pickColor(a)
|
||||
}
|
||||
});
|
||||
|
||||
farbtastic = jQuery.farbtastic("#color-picker-div",function(a){
|
||||
pickColor(a)
|
||||
});
|
||||
pickColor(jQuery("#bg_color").val());
|
||||
|
||||
jQuery(document).mousedown(function(){
|
||||
jQuery("#color-picker-div").each(function(){
|
||||
var a = jQuery(this).css("display");
|
||||
if (a == "block") {
|
||||
jQuery('#pickcolor.selected').removeClass('selected');
|
||||
jQuery(this).fadeOut(2);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************
|
||||
** RECALCULATE IMAGES IF NECESSARY
|
||||
****************************************/
|
||||
<?php if ($recalculate_thumbnails || $recalculate_fullsize): ?>
|
||||
discourage_leaving_page('<?php _e("Please allow the rendering to complete before leaving this page. Click cancel to go back and let the rendering complete.", "catablog"); ?>');
|
||||
|
||||
$('#save_changes').attr('disabled', true);
|
||||
var nonce = '<?php echo wp_create_nonce("catablog-render-images") ?>';
|
||||
var images = ["<?php echo implode('", "', $image_names) ?>"];
|
||||
var warning = '<?php _e("Image rendering is not complete, you should let image rendering complete before leaving this page.", "catablog"); ?>';
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
|
||||
<?php if ($recalculate_thumbnails): ?>
|
||||
var thumbs = images.slice(0);
|
||||
renderCataBlogItems(thumbs, 'thumbnail', nonce, function() {
|
||||
// jQuery('#catablog-progress-thumbnail .catablog-progress-text').html(message);
|
||||
|
||||
var t = setTimeout(function() {
|
||||
jQuery('#catablog-progress-thumbnail').hide('medium');
|
||||
jQuery('#message').hide('medium');
|
||||
}, 2000);
|
||||
|
||||
$('#save_changes').attr('disabled', false);
|
||||
|
||||
<?php if ($recalculate_fullsize == false): ?>
|
||||
unbind_discourage_leaving_page();
|
||||
<?php endif ?>
|
||||
});
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
|
||||
<?php if ($recalculate_fullsize): ?>
|
||||
var fullsize = images.slice(0);
|
||||
renderCataBlogItems(fullsize, 'fullsize', nonce, function() {
|
||||
// jQuery('#catablog-progress-fullsize .catablog-progress-text').html(message);
|
||||
|
||||
var t = setTimeout(function() {
|
||||
jQuery('#catablog-progress-thumbnail').hide('medium');
|
||||
jQuery('#catablog-progress-fullsize').hide('medium');
|
||||
jQuery('#message').hide('medium');
|
||||
}, 2000);
|
||||
|
||||
$('#save_changes').attr('disabled', false);
|
||||
|
||||
unbind_discourage_leaving_page();
|
||||
});
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // end onReady method
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@ -0,0 +1,60 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("CataBlog Images Rendering", "catablog"); ?></h2>
|
||||
|
||||
<noscript>
|
||||
<div class="error">
|
||||
<strong><?php _e("You must have a JavaScript enabled browser to regenerate your images.", "catablog"); ?></strong>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<?php if (count($image_names) < 1): ?>
|
||||
<p><?php _e("Your CataBlog library is empty, there are no images to render.", "catablog") ?></p>
|
||||
</div><!-- END div.wrap -->
|
||||
<?php return false; ?>
|
||||
<?php endif ?>
|
||||
|
||||
<div id="catablog-progress-thumbnail" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Processing Thumbnail Images...", "catablog"); ?></h3>
|
||||
</div>
|
||||
|
||||
<?php if ($this->options['lightbox-render']): ?>
|
||||
<div id="catablog-progress-fullsize" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Waiting For Thumbnail Rendering To Finish...", "catablog"); ?></h3>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<ul id="catablog-console">
|
||||
<li><?php _e('Rendering all images from their original files, this may take awhile so please be patient.', 'catablog') ?></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
var images = ["<?php echo implode('", "', $image_names) ?>"];
|
||||
var nonce = '<?php echo wp_create_nonce("catablog-render-images") ?>';
|
||||
var message = '<?php _e("Image rendering is now complete, you may now go to any other admin panel you may want.", "catablog"); ?>';
|
||||
|
||||
discourage_leaving_page('<?php _e("Please allow the rendering to complete before leaving this page. Click cancel to go back and let the rendering complete.", "catablog"); ?>');
|
||||
|
||||
renderCataBlogItems(images, 'thumbnail', nonce, function() {
|
||||
|
||||
<?php if ($this->options['lightbox-render']): ?>
|
||||
var images = ["<?php echo implode('", "', $image_names) ?>"];
|
||||
renderCataBlogItems(images, 'fullsize', nonce, function() {
|
||||
jQuery('#catablog-console').append('<li class="updated">'+message+'</li>');
|
||||
unbind_discourage_leaving_page();
|
||||
});
|
||||
<?php else: ?>
|
||||
jQuery('#catablog-console').append('<li class="updated">'+message+'</li>');
|
||||
unbind_discourage_leaving_page();
|
||||
<?php endif ?>
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
97
src/wp-content/plugins/catablog/templates/admin-remove.php
Normal file
@ -0,0 +1,97 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("CataBlog Remove", "catablog"); ?></h2>
|
||||
|
||||
<noscript>
|
||||
<div class="error">
|
||||
<strong><?php _e("You must have a JavaScript enabled browser to remove your catalog installation, sorry...", "catablog"); ?></strong>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<div id="catablog-progress" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"> </div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Removing CataBlog...", "catablog"); ?></h3>
|
||||
</div>
|
||||
|
||||
<ul id="catablog-console"></ul>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var progress_bar = $('#catablog-progress div.catablog-progress-bar');
|
||||
|
||||
|
||||
|
||||
delete_library_part();
|
||||
|
||||
|
||||
|
||||
|
||||
function delete_library_part() {
|
||||
var params = {
|
||||
'action': 'catablog_delete_library',
|
||||
'security': '<?php echo wp_create_nonce("catablog-delete-library") ?>',
|
||||
}
|
||||
|
||||
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.error);
|
||||
}
|
||||
else {
|
||||
if (json.remaining > 0) {
|
||||
var console_message = "<li>" + json.message + "</li>";
|
||||
$('#catablog-console').append(console_message);
|
||||
progress_bar.width((progress_bar.width() + 20));
|
||||
delete_library_part();
|
||||
}
|
||||
else {
|
||||
var console_message = "<li><strong>" + json.message + "</strong></li>";
|
||||
$('#catablog-console').append(console_message);
|
||||
progress_bar.css('width', '50%');
|
||||
delete_system();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error) {alert(error);}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function delete_system() {
|
||||
var params = {
|
||||
'action': 'catablog_delete_system',
|
||||
'security': '<?php echo wp_create_nonce("catablog-delete-system")?>'
|
||||
}
|
||||
|
||||
$.post(ajaxurl, params, function(data) {
|
||||
try {
|
||||
var json = eval(data);
|
||||
if (json.success == false) {
|
||||
alert(json.error);
|
||||
}
|
||||
else {
|
||||
progress_bar.css('width', '100%');
|
||||
var console_message = "<li><strong>" + json.message + "</strong></li>";
|
||||
$('#catablog-console').append(console_message);
|
||||
var console_message = "<li><strong>" + json.message2 + "</strong></li>";
|
||||
$('#catablog-console').append(console_message);
|
||||
var console_message = "<li><strong>" + json.message3 + "</strong></li>";
|
||||
$('#catablog-console').append(console_message);
|
||||
}
|
||||
}
|
||||
catch(error) { alert(error); }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
87
src/wp-content/plugins/catablog/templates/admin-rescan.php
Normal file
@ -0,0 +1,87 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-catablog" class="icon32"><br /></div>
|
||||
<h2><?php _e("CataBlog Rescan Original Images Results", "catablog"); ?></h2>
|
||||
|
||||
<?php $this->render_catablog_admin_message() ?>
|
||||
|
||||
<?php if (count($new_rows['images']) < 1): ?>
|
||||
<ul id="catablog-console">
|
||||
<li><?php _e("No new images where found in your originals folders.", 'catablog'); ?></li>
|
||||
<li><?php _e("Please make sure that you have successfully uploaded new images via FTP before running this command.", "catablog"); ?></li>
|
||||
<li><?php _e("New images should be uploaded into the following folder:", "catablog"); ?></li>
|
||||
<li><code><?php echo $this->directories['originals'] ?></code></li>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<noscript>
|
||||
<div class="error">
|
||||
<strong><?php _e("You must have a JavaScript enabled browser to regenerate your images.", "catablog"); ?></strong>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div id="catablog-progress-thumbnail" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Processing Thumbnail Images...", "catablog"); ?></h3>
|
||||
</div>
|
||||
|
||||
<?php if ($this->options['lightbox-render']): ?>
|
||||
<div id="catablog-progress-fullsize" class="catablog-progress">
|
||||
<div class="catablog-progress-bar"></div>
|
||||
<h3 class="catablog-progress-text"><?php _e("Waiting For Thumbnail Rendering To Finish...", "catablog"); ?></h3>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<ul id="catablog-console">
|
||||
<?php foreach ($new_rows['titles'] as $title): ?>
|
||||
<li class="message"><?php printf(__("New Image Found, creating catalog item %s", "catablog"), "<strong>$title</strong>"); ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
<?php if (count($new_rows['images']) < 1): ?>
|
||||
return false;
|
||||
<?php endif ?>
|
||||
|
||||
discourage_leaving_page('<?php _e("Please allow the rendering to complete before leaving this page. Click cancel to go back and let the rendering complete.", "catablog"); ?>');
|
||||
|
||||
/****************************************
|
||||
** CALCULATE NEW IMAGES
|
||||
****************************************/
|
||||
var nonce = '<?php echo wp_create_nonce("catablog-render-images") ?>';
|
||||
var images = ["<?php echo implode('", "', $new_rows['images']) ?>"];
|
||||
|
||||
var thumbs = images.slice(0);
|
||||
renderCataBlogItems(thumbs, 'thumbnail', nonce, function() {
|
||||
|
||||
<?php if ($this->options['lightbox-render']): ?>
|
||||
|
||||
var fullsize = images.slice(0);
|
||||
renderCataBlogItems(fullsize, 'fullsize', nonce, function() {
|
||||
|
||||
unbind_discourage_leaving_page();
|
||||
var t = setTimeout(function() {
|
||||
jQuery('#catablog-progress-thumbnail').hide('medium');
|
||||
jQuery('#catablog-progress-fullsize').hide('medium');
|
||||
jQuery('#message').hide('medium');
|
||||
}, 2000);
|
||||
$('#save_changes').attr('disabled', false);
|
||||
|
||||
});
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
unbind_discourage_leaving_page();
|
||||
var t = setTimeout(function() {
|
||||
jQuery('#catablog-progress-thumbnail').hide('medium');
|
||||
jQuery('#message').hide('medium');
|
||||
}, 2000);
|
||||
$('#save_changes').attr('disabled', false);
|
||||
|
||||
<?php endif ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
$fields = array('description', 'link', 'price', 'product_code', 'categories', 'order', 'date');
|
||||
|
||||
$user = wp_get_current_user();
|
||||
$screen_settings = get_user_meta($user->ID, 'catablog_screen_settings', true);
|
||||
|
||||
// prosses screen options form if submitted
|
||||
$nonce_verified = wp_verify_nonce( $_REQUEST['_catablog_screen_settings_nonce'], 'catablog_screen_settings' );
|
||||
if (isset($_POST['entry-per-page']) && $nonce_verified) {
|
||||
|
||||
$screen_settings['hide-columns'] = array();
|
||||
foreach ($fields as $field) {
|
||||
if (!in_array($field, $_REQUEST['hide'])) {
|
||||
$screen_settings['hide-columns'][] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_numeric($_REQUEST['entry-per-page'])) {
|
||||
$screen_settings['limit'] = 1;
|
||||
if ($_REQUEST['entry-per-page'] > 1) {
|
||||
$screen_settings['limit'] = $_REQUEST['entry-per-page'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$screen_settings['limit'] = 20;
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
update_user_meta($user->ID, 'catablog_screen_settings', $screen_settings);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php $screen_settings['hide-columns'] = (is_array($screen_settings['hide-columns']))? $screen_settings['hide-columns'] : array() ?>
|
||||
|
||||
<h5><?php _e('Show on screen', 'catablog') ?></h5>
|
||||
<div class="metabox-prefs">
|
||||
<?php foreach ($fields as $field): ?>
|
||||
<?php $checked = (!in_array($field, $screen_settings['hide-columns']))? ' checked="checked"' : '' ?>
|
||||
<label for="hide-column-<?php echo $field ?>"><input class="hide-catablog-column-tog" type="checkbox" name="hide[]" value="<?php echo $field ?>" id="hide-column-<?php echo $field ?>"<?php echo $checked ?>><?php _e(ucwords(str_replace('_', ' ', $field)), 'catablog') ?></label>
|
||||
<?php endforeach ?>
|
||||
<br class="clear">
|
||||
</div>
|
||||
|
||||
<h5><?php _e('Show on screen', 'catablog') ?></h5>
|
||||
<div class='screen-options'>
|
||||
<input type='text' class='screen-per-page' name='entry-per-page' id='entry_per_page' maxlength='3' value='<?php echo $screen_settings['limit'] ?>' />
|
||||
<label for='entry_per_page'><?php _e('Catalog items', 'catablog') ?></label>
|
||||
<?php wp_nonce_field( 'catablog_screen_settings', '_catablog_screen_settings_nonce', false, true ) ?>
|
||||
<input type="submit" name="screen-options-apply" id="screen-options-apply" class="button" value="<?php _e('Apply', 'catablog') ?>" />
|
||||
</div>
|
||||
|
||||
15
src/wp-content/plugins/catablog/templates/buttons/paypal.htm
Normal file
@ -0,0 +1,15 @@
|
||||
<form method='post' action='https://www.paypal.com/cgi-bin/webscr' target='paypal'>
|
||||
<input type='hidden' name='cmd' value='_cart'>
|
||||
<input type='hidden' name='business' value='%PAYPAL-EMAIL%'>
|
||||
<input type='hidden' name='item_name' value='%TITLE-TEXT%'>
|
||||
<input type='hidden' name='item_number' value='%PRODUCT-CODE%'>
|
||||
<input type='hidden' name='amount' value='%PRICE%'>
|
||||
|
||||
<input type='hidden' name='shipping' value='0.00'>
|
||||
<input type='hidden' name='currency_code' value='USD'>
|
||||
<input type='hidden' name='return' value=''>
|
||||
<input type='hidden' name='quantity' value='1'>
|
||||
<input type='hidden' name='add' value='1'>
|
||||
<input type='image' src='http://images.paypal.com/en_US/i/btn/x-click-but22.gif' border='0' name='submit' width='87' height='23' alt='Add to Cart'>
|
||||
</form>
|
||||
|
||||
14
src/wp-content/plugins/catablog/templates/views/default.htm
Normal file
@ -0,0 +1,14 @@
|
||||
<div class='catablog-row %CATEGORY-SLUGS%'>
|
||||
<div class="catablog-images-column">
|
||||
%MAIN-IMAGE%
|
||||
%SUB-IMAGES%
|
||||
</div>
|
||||
|
||||
<h3 class='catablog-title'>%TITLE-LINK%</h3>
|
||||
|
||||
<div class="catablog-description">
|
||||
<p>%DESCRIPTION%</p>
|
||||
%BUY-NOW-BUTTON%
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -0,0 +1,7 @@
|
||||
<div class="catablog-row catablog-gallery">
|
||||
<a href="%LINK%" class="catablog-image" %LINK-TARGET% %LINK-REL%>
|
||||
<img src="%IMAGE-THUMBNAIL%" alt="" />
|
||||
<strong class="catablog-title">%TITLE%</strong>
|
||||
</a>
|
||||
<div class="catablog-description">%DESCRIPTION%</div>
|
||||
</div>
|
||||
11
src/wp-content/plugins/catablog/templates/views/single.htm
Normal file
@ -0,0 +1,11 @@
|
||||
<div class='catablog-row'>
|
||||
<div class="catablog-images-column">
|
||||
%MAIN-IMAGE%
|
||||
%SUB-IMAGES%
|
||||
</div>
|
||||
|
||||
<div class="catablog-description">
|
||||
%DESCRIPTION%
|
||||
%BUY-NOW-BUTTON%
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Custom Post Background
|
||||
Plugin URI: http://blogtap.net/custom_post_background_plugin.shtml
|
||||
Description: Allow each post or page to have a custom background. Has the ability to edit the style of each post individually.
|
||||
Version: 1.3.1.0
|
||||
Author: David Sherret
|
||||
Author URI: http://blogtap.net
|
||||
*/
|
||||
define("custPostBack_name", "Custom Post Background");
|
||||
define("custPostBack_dbtable", "customBack");
|
||||
/* Copyright 2009 David Sherret (email : admin@davidsherret.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
//install the plugin
|
||||
require_once('custom-post-back_mysql.php');
|
||||
register_activation_hook(__FILE__,'custompostback_install');
|
||||
//get the includes needed
|
||||
require_once('custom-post-back_admin.php');
|
||||
require_once('custom-post-back_post.php');
|
||||
?>
|
||||
@ -0,0 +1,246 @@
|
||||
<?php
|
||||
/*
|
||||
This file contains all the admin data needed to make the admin page
|
||||
*/
|
||||
|
||||
// Updated: 14/04/2011 - Malcolm Shergold - Admin screen now uses meta-box interface
|
||||
|
||||
// WP 3.0+
|
||||
add_action('admin_menu', 'postback_add_custom_box');
|
||||
add_action('save_post', 'save_custom_data', 1, 2);
|
||||
add_action('delete_post', 'delete_custom_data' );
|
||||
|
||||
function save_custom_data($post_id, $post) {
|
||||
global $wpdb;
|
||||
|
||||
if (!$post_id) $post_id = $_POST['post_ID'];
|
||||
if (!$post_id) return $post;
|
||||
|
||||
// verify this came from the our screen and with proper authorization,
|
||||
// because save_post can be triggered at other times
|
||||
// MJS - Added !isset($_POST['postback_noncename'])
|
||||
if (!isset($_POST['postback_noncename']) || !wp_verify_nonce( $_POST['postback_noncename'], plugin_basename(__FILE__) ) )
|
||||
{
|
||||
return $post;
|
||||
}
|
||||
|
||||
//check to see if it needs to be edited
|
||||
if (isset($_POST['custBack_img_source']))
|
||||
{
|
||||
//then it is a postback, check what the Background Source is set as
|
||||
if($_POST['custBack_img_source'] == 0) //image page
|
||||
{
|
||||
$url = $_POST['custBack_img_Database'];
|
||||
}
|
||||
else if($_POST['custBack_img_source'] == 1) //from url
|
||||
{
|
||||
$url = $_POST['custBack_url_edit'];
|
||||
}
|
||||
else //it's disabled
|
||||
{
|
||||
$url = "";
|
||||
}
|
||||
|
||||
$table_name = $wpdb->prefix . constant("custPostBack_dbtable");
|
||||
if ($_POST['custBack_id_edit'] != 0)
|
||||
{
|
||||
//now update the data
|
||||
$update = "UPDATE ".$table_name." SET url='".$url."',
|
||||
rep='".$_POST['custBack_repeat_edit']."', color='".$_POST['custBack_color_edit']."', css='".$_POST['custBack_css_edit']."',
|
||||
displaytype = '".$_POST['custBack_displaytype_edit']."'
|
||||
WHERE id='".$_POST['custBack_id_edit']."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
//now add the data
|
||||
$update = "INSERT INTO ".$table_name." (postid,url,rep,color,css,displaytype)";
|
||||
$update .= " VALUES('".$post_id."', '".$url."', '".$_POST['custBack_repeat_edit']."', '".$_POST['custBack_color_edit']."', '".$_POST['custBack_css_edit']."', '".$_POST['custBack_displaytype_edit']."')";
|
||||
}
|
||||
|
||||
|
||||
$wpdb->query($update);
|
||||
|
||||
$msg = "Save Background Settings SQL:\n";
|
||||
$msg .= $update . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
function delete_custom_data($post_id) {
|
||||
global $wpdb;
|
||||
|
||||
$table_name = $wpdb->prefix . constant("custPostBack_dbtable");
|
||||
|
||||
// delete the link to the post in the custBack table
|
||||
$deleteBack = "DELETE FROM $table_name WHERE postid='".$post_id."' LIMIT 1";
|
||||
$wpdb->query($deleteBack);
|
||||
}
|
||||
|
||||
function postback_add_custom_box() {
|
||||
if( function_exists( 'add_meta_box' )) {
|
||||
add_meta_box( 'custPostBack', __( 'Page Background' ), 'custPostBack_metabox', 'post', 'normal', 'core' );
|
||||
add_meta_box( 'custPostBack', __( 'Page Background' ), 'custPostBack_metabox', 'page', 'normal', 'core' );
|
||||
}
|
||||
}
|
||||
|
||||
//here is the page that contains the options that are going to be used for the plugin
|
||||
function custPostBack_metabox($post, $custPostBack_callbackargs)
|
||||
{
|
||||
global $wpdb;
|
||||
global $post_id;
|
||||
|
||||
//get the table names
|
||||
$table_name = $wpdb->prefix . constant("custPostBack_dbtable");
|
||||
$table_post = $wpdb->posts;
|
||||
|
||||
//code to display data
|
||||
echo '<div class="wrap">';
|
||||
|
||||
//the links section
|
||||
echo '<p><a href="http://blogtap.net/software.shtml" target="_blank">More Software</a> | <a href="http://blogtap.net/custom_post_background_plugin.shtml" target="_blank">Donate</a> | <a href="http://blogtap.net/custom_post_background_plugin.shtml" target="_blank">Information</a> | <a href="http://blogtap.net/contact.shtml" target="_blank">Contact Us</a></p>';
|
||||
|
||||
//check to see if this post has a background entry in the DB
|
||||
$queryEditOne = "SELECT * FROM ".$table_name." WHERE postid='".$post_id."' LIMIT 1";
|
||||
|
||||
$rEditBack = $wpdb->get_row($queryEditOne);
|
||||
|
||||
if(!$rEditBack)
|
||||
{
|
||||
// Set-up defaults
|
||||
$rEditBack->id = 0; // 0 = No entry for this Post
|
||||
$rEditBack->postid = $post_id;
|
||||
$rEditBack->url = '';
|
||||
$rEditBack->rep = "none";
|
||||
$rEditBack->color = '';
|
||||
$rEditBack->css = '';
|
||||
$rEditBack->displaytype = "0";
|
||||
}
|
||||
|
||||
//figure out how the background source will be displayed
|
||||
$linkId = "";
|
||||
if(strlen($rEditBack->url) > 0)
|
||||
{
|
||||
//check if the posts table contains the link to the image
|
||||
$linkId = $wpdb->get_var("SELECT id FROM ".$wpdb->posts." WHERE guid='".$rEditBack->url."' LIMIT 1");
|
||||
}
|
||||
$resultImages = $wpdb->get_results("SELECT id, guid, post_title, post_name FROM ".$wpdb->posts." WHERE post_mime_type LIKE 'image%'");
|
||||
|
||||
// Use nonce for verification
|
||||
wp_nonce_field( plugin_basename(__FILE__), 'postback_noncename' );
|
||||
|
||||
//echo '<h3>Edit Background: '.$resultPosts->post_title.'</h3>';
|
||||
|
||||
echo '
|
||||
<input type="hidden" name="custBack_id_edit" value="'.$rEditBack->id.'" />
|
||||
|
||||
<div id="postcustomstuff">
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="25%" style="text-align: right; vertical-align: middle;">'.__('Source').':</td>
|
||||
<td width="75%" >
|
||||
<select name="custBack_img_source" id="custBack_img_source"
|
||||
onchange="
|
||||
if(this.options[this.selectedIndex].value == 0)
|
||||
{
|
||||
document.getElementById(\'rowMedia\').style.visibility = \'visible\';
|
||||
document.getElementById(\'rowMedia\').style.display = \'\';
|
||||
document.getElementById(\'rowUrl\').style.visibility = \'hidden\';
|
||||
document.getElementById(\'rowUrl\').style.display = \'none\';
|
||||
}
|
||||
else if(this.options[this.selectedIndex].value == 1)
|
||||
{
|
||||
document.getElementById(\'rowMedia\').style.visibility = \'hidden\';
|
||||
document.getElementById(\'rowMedia\').style.display = \'none\';
|
||||
document.getElementById(\'rowUrl\').style.visibility = \'visible\';
|
||||
document.getElementById(\'rowUrl\').style.display = \'\';
|
||||
}
|
||||
else if(this.options[this.selectedIndex].value == 2)
|
||||
{
|
||||
document.getElementById(\'rowMedia\').style.visibility = \'hidden\';
|
||||
document.getElementById(\'rowMedia\').style.display = \'none\';
|
||||
document.getElementById(\'rowUrl\').style.visibility = \'hidden\';
|
||||
document.getElementById(\'rowUrl\').style.display = \'none\';
|
||||
}
|
||||
">';
|
||||
|
||||
//make sure the properly selected option is selected
|
||||
$isMediaImage = ($linkId != "");
|
||||
$isImageURL = (($linkId == "") && (strlen($rEditBack->url) > 0));
|
||||
|
||||
if (count($resultImages) >= 1)
|
||||
echo '<option value="0" '.($isMediaImage ? 'selected' : '').'>'.__('Image From Media').'  </option>';
|
||||
echo '<option value="1" '.($isImageURL ? 'selected' : '').'>'.__('Image From URL').'</option>';
|
||||
echo '<option value="2" '.((!$isMediaImage && !$isImageURL) ? 'selected' : '').'>'.__('Disable').'</option>';
|
||||
echo '
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
echo '<tr id="rowMedia" style="visibility:'.($isMediaImage ? 'visible;' : 'hidden; display:none;').'">
|
||||
<td style="text-align: right; vertical-align: middle;">Image From Media:</td>
|
||||
<td><select name="custBack_img_Database">';
|
||||
foreach($resultImages as $images)
|
||||
{
|
||||
//display the file
|
||||
echo '<option value="'.$images->guid.'" '.($images->id == $linkId ? 'selected' : '').'>'.$images->post_title.' ('.$images->post_name.')</option>';
|
||||
}
|
||||
echo '</select></td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
echo '<tr id="rowUrl" style="visibility:'.($isImageURL ? 'visible;' : 'hidden; display:none;').'">
|
||||
<td style="text-align: right; vertical-align: middle;">URL:</td>
|
||||
<td><input type="text" name="custBack_url_edit"
|
||||
value="';
|
||||
|
||||
if($linkId == "") echo $rEditBack->url; //if the link is not in the posts table, then output the url here
|
||||
|
||||
echo '" size="40" class="widefat" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; vertical-align: middle;">'.__('Repeat').':</td>
|
||||
<td><select name="custBack_repeat_edit">';
|
||||
|
||||
//area for selecting repeat type
|
||||
echo '<option value="none" '.($rEditBack->rep == "none" ? 'selected' : '').'>'.__('None').'</option>';
|
||||
echo '<option value="x" '.($rEditBack->rep == "x" ? 'selected' : '').'>'.__('Repeat X').'</option>';
|
||||
echo '<option value="y" '.($rEditBack->rep == "y" ? 'selected' : '').'>'.__('Repeat Y').'</option>';
|
||||
echo '<option value="both" '.($rEditBack->rep == "both" ? 'selected' : '').'>'.__('Both').'</option>';
|
||||
echo '</select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="text-align: right; vertical-align: middle;">'.__('Background Color').':</td><td><input type="text" name="custBack_color_edit" value="'.$rEditBack->color.'" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; vertical-align: middle;">CSS:</td><td><textarea name="custBack_css_edit" rows="4" cols="40">'.$rEditBack->css.'</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right; vertical-align: middle;">'.__('Display Type').':</td>
|
||||
<td>';
|
||||
|
||||
//area for selecting display type
|
||||
echo '
|
||||
<select name="custBack_displaytype_edit">
|
||||
<option value="'.CPB_DISPLAY_POSTPAGE.'" '.($rEditBack->displaytype == CPB_DISPLAY_POSTPAGE ? 'selected' : '').'>'.__('Only on Post Page').'</option>
|
||||
<option value="'.CPB_DISPLAY_MAINPAGE.'" '.($rEditBack->displaytype == CPB_DISPLAY_MAINPAGE ? 'selected' : '').'>'.__('Only on Main/Archives Page').'</option>
|
||||
<option value="'.CPB_DISPLAY_BOTHPAGES.'" '.($rEditBack->displaytype == CPB_DISPLAY_BOTHPAGES ? 'selected' : '').'>'.__('On both pages').'</option>
|
||||
<option value="'.CPB_DISPLAY_BACKGROUND.'" '.($rEditBack->displaytype == CPB_DISPLAY_BACKGROUND ? 'selected' : '').'>'.__('Post Page background').'</option>
|
||||
<option value="'.CPB_DISPLAY_WHOLEPAGE.'" '.($rEditBack->displaytype == CPB_DISPLAY_WHOLEPAGE ? 'selected' : '').'>'.__('Whole Page').'</option>
|
||||
<option value="'.CPB_DISPLAY_DISABLED.'" '.($rEditBack->displaytype == CPB_DISPLAY_DISABLED ? 'selected' : '').'>'.__('Disable - Do Not display').'</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</div>
|
||||
';
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/*
|
||||
This file contains the installation functions
|
||||
*/
|
||||
|
||||
$custpostback_db_version = "1.1";
|
||||
|
||||
function custompostback_install()
|
||||
{
|
||||
global $wpdb;
|
||||
global $custpostback_db_version;
|
||||
|
||||
$table_name = $wpdb->prefix . constant("custPostBack_dbtable");
|
||||
|
||||
$installed_ver = get_option( "custpostback_db_version" );
|
||||
|
||||
//check if it has not been installed or database needs update
|
||||
if ( ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name)
|
||||
|| ($installed_ver != $custpostback_db_version) )
|
||||
{
|
||||
// MJS - Default not allowed on TEXT fields - removed
|
||||
// MJS - dbDelta() needs a space in UNIQUE KEY def between keiId and (
|
||||
$sql = "CREATE TABLE ".$table_name." (
|
||||
id bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
postid bigint(20) NULL,
|
||||
url text NULL,
|
||||
rep VARCHAR(5) NULL DEFAULT 'none',
|
||||
color VARCHAR(25) NULL,
|
||||
css TEXT NULL,
|
||||
displaytype TINYINT(1) NULL DEFAULT '".CPB_DISPLAY_BACKGROUND."',
|
||||
UNIQUE KEY id (id)
|
||||
);";
|
||||
|
||||
//excecute the query
|
||||
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
||||
dbDelta($sql);
|
||||
|
||||
update_option("custpostback_db_version", $custpostback_db_version);
|
||||
}
|
||||
|
||||
$rowsPerPage = get_option('custBack_resultspp');
|
||||
//if the amount of rows per page is less than the minimum 10, then update it
|
||||
if($rowsPerPage < 10)
|
||||
{
|
||||
update_option('custBack_resultspp', 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
define('CPB_DISPLAY_POSTPAGE', '0');
|
||||
define('CPB_DISPLAY_MAINPAGE', '1');
|
||||
define('CPB_DISPLAY_BOTHPAGES', '2');
|
||||
define('CPB_DISPLAY_BACKGROUND', '3');
|
||||
define('CPB_DISPLAY_DISABLED', '4');
|
||||
define('CPB_DISPLAY_WHOLEPAGE', '5');
|
||||
|
||||
add_action('the_content', 'custompostback_process');
|
||||
|
||||
function custompostback_style($results, $new_data)
|
||||
{
|
||||
if(strlen($results->url) > 0)
|
||||
{
|
||||
$new_data .= "background-image: url('".$results->url."');";
|
||||
}
|
||||
|
||||
if(strlen($results->rep) > 0)
|
||||
{
|
||||
if($results->rep == "x" || $results->rep == "y")
|
||||
{
|
||||
$new_data .= "background-repeat: repeat-".$results->rep.";";
|
||||
}
|
||||
else if($results->rep == "both")
|
||||
{
|
||||
$new_data .= "background-repeat: repeat;";
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_data .= "background-repeat: no-repeat;";
|
||||
}
|
||||
}
|
||||
|
||||
if(strlen($results->color) > 0)
|
||||
{
|
||||
//probably should have some code to check if it's hexadecimal
|
||||
$new_data .= "background-color: ".$results->color.";";
|
||||
}
|
||||
|
||||
if(strlen($results->css) > 0)
|
||||
{
|
||||
$new_data .= $results->css;
|
||||
}
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
function custompostback_process($data)
|
||||
{
|
||||
global $post;
|
||||
global $wpdb;
|
||||
|
||||
//get the table name
|
||||
$table_name = $wpdb->prefix . constant("custPostBack_dbtable");
|
||||
|
||||
$post_id = get_the_ID();
|
||||
|
||||
|
||||
$display = true;
|
||||
if (is_home()) $display = false;
|
||||
if (is_archive()) $display = false;
|
||||
if (is_date()) $display = false;
|
||||
if (is_category()) $display = false;
|
||||
if (is_search()) $display = false;
|
||||
if (is_feed()) $display = false;
|
||||
|
||||
//sql data
|
||||
$queryBacks = "SELECT * FROM ".$table_name." WHERE postid='".$post_id."' LIMIT 1";
|
||||
$results = $wpdb->get_row($queryBacks);
|
||||
|
||||
//check if the display type is set to not display. If so there is no need to go any further
|
||||
if($results && $results->displaytype == CPB_DISPLAY_DISABLED)
|
||||
{
|
||||
return $data; //no need to continue. It is currently disabled.
|
||||
}
|
||||
|
||||
if($display)
|
||||
{
|
||||
if($results && $results->displaytype != CPB_DISPLAY_MAINPAGE) //if it's set to only display on the main page, then only display on the main page
|
||||
{
|
||||
$new_data = "";
|
||||
if ($results->displaytype == CPB_DISPLAY_BACKGROUND || $results->displaytype == CPB_DISPLAY_WHOLEPAGE)
|
||||
{
|
||||
$new_data = '<style type="text/css">';
|
||||
$new_data .= '#content {';
|
||||
}
|
||||
|
||||
//do the style part
|
||||
$new_data = custompostback_style($results, $new_data);
|
||||
|
||||
if ($results->displaytype == CPB_DISPLAY_BACKGROUND || $results->displaytype == CPB_DISPLAY_WHOLEPAGE)
|
||||
{
|
||||
$new_data .= '}';
|
||||
if ($results->displaytype == CPB_DISPLAY_WHOLEPAGE)
|
||||
$new_data .= ' #wrapper { background-color: transparent; }';
|
||||
$new_data .= "</style>";
|
||||
$data = $new_data . $data;
|
||||
}
|
||||
else if($results->displaytype == CPB_DISPLAY_POSTPAGE || $results->displaytype == CPB_DISPLAY_BOTHPAGES) //display only on post or both
|
||||
{
|
||||
//add to the end of the actual data
|
||||
$data = '<div style="'.$new_data.'">'.$data.'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($results && ($results->displaytype == CPB_DISPLAY_MAINPAGE || $results->displaytype == CPB_DISPLAY_BOTHPAGES)) //check to see if it equals 1 (so that means to display it on the main page and archives) or on both
|
||||
{
|
||||
$new_data = custompostback_style($results,$new_data);
|
||||
$data = '<div style="'.$new_data.'">'.$data.'</div>';
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
?>
|
||||
53
src/wp-content/plugins/custom-post-background/readme.txt
Normal file
@ -0,0 +1,53 @@
|
||||
=== Plugin Name ===
|
||||
Contributors: blogtap.net
|
||||
Donate link: http://blogtap.net/custom_post_background_plugin.shtml
|
||||
Tags: background, style, post, modification
|
||||
Requires at least: 2.0
|
||||
Tested up to: 3.1.1
|
||||
Stable tag: 1.3.1.0
|
||||
|
||||
Create custom backgrounds or styles for your posts and pages.
|
||||
|
||||
== Description ==
|
||||
|
||||
The Custom Post Background plugin for Wordpress adds a great deal of visual customization ability to your blog posts and page appearances. It allows you to easily change the background of individual blog posts/pages using CSS or an image URL (with or without a x/y/both repeat).. For any page, CPB displays a meta-box with fields where you can then make your background customizations.
|
||||
|
||||
You can change the background with CSS/URL of image to apply to only the background of the post, only on the background of the home/main page, or both pages.
|
||||
The "Color" feild option allows you to quickly make background changes using the background-color CSS code. You can enter any color (such as "red," "blue," "green") or enter a hex value, like: #A9A7A7. You can also change the whole page background (not just the post background) of any individual post with the "Display as page background on post page" option.
|
||||
|
||||
Version 1.1.0.0 Updates
|
||||
-Added paging to administration area.
|
||||
|
||||
Version 1.2.0.0 Updates
|
||||
-Added option of setting background image to image in media page
|
||||
|
||||
Version 1.3.0.0 Updates
|
||||
-Removed css field DEFAULT value
|
||||
-Implemented database version update
|
||||
-Admin page changed to meta-box on Page/Post edit pages
|
||||
-Display type changed from radio buttons to drop down list
|
||||
|
||||
Version 1.3.1.0 Updates
|
||||
-Added Whole Page option - As "Page Background" but with transparent Post/Page background
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Download the custom-post-background.zip
|
||||
1. Navigate to the plugins page in your administrator panel.
|
||||
1. Click the Plugin Browser/Install link.
|
||||
1. Under "Install a plugin in .zip format" choose the custom-post-background.zip file
|
||||
1. Click Install Now.
|
||||
1. After it has installed, activate the plugin.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= How do I edit a page's background? =
|
||||
|
||||
1. Navigate to the editor for the Page you want to add/edit the background image
|
||||
1. Locate the "Page Background" meta-box
|
||||
1. Modify the settings to your liking.
|
||||
1. Click the "Update" button to confirm your changes.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. screenshot-1.png
|
||||
BIN
src/wp-content/plugins/custom-post-background/screenshot-1.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: jQuery Vertical Accordion Menu
|
||||
Plugin URI: http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/
|
||||
Tags: jquery, dropdown, menu, vertical accordion, animated, css, navigation, accordion
|
||||
Description: Creates a widget, which allows you to create vertical accordion menus from any Wordpress custom menu using jQuery. Features include - handles multiple levels, saved state using cookies and option of selecting "click" or "hover" events for triggering the menu.
|
||||
Author: Lee Chestnutt
|
||||
Version: 2.6
|
||||
Author URI: http://www.designchemical.com
|
||||
*/
|
||||
|
||||
global $registered_skins;
|
||||
|
||||
class dc_jqaccordion {
|
||||
|
||||
function dc_jqaccordion(){
|
||||
global $registered_skins;
|
||||
|
||||
if(!is_admin()){
|
||||
// Header styles
|
||||
add_action( 'wp_head', array('dc_jqaccordion', 'header') );
|
||||
|
||||
// Scripts
|
||||
wp_enqueue_script( 'jquery' );
|
||||
wp_enqueue_script( 'jqueryhoverintent', dc_jqaccordion::get_plugin_directory() . '/js/jquery.hoverIntent.minified.js', array('jquery') );
|
||||
wp_enqueue_script( 'jquerycookie', dc_jqaccordion::get_plugin_directory() . '/js/jquery.cookie.js', array('jquery') );
|
||||
wp_enqueue_script( 'dcjqaccordion', dc_jqaccordion::get_plugin_directory() . '/js/jquery.dcjqaccordion.2.8.js', array('jquery') );
|
||||
}
|
||||
add_action( 'wp_footer', array('dc_jqaccordion', 'footer') );
|
||||
|
||||
$registered_skins = array();
|
||||
}
|
||||
|
||||
function header(){
|
||||
//echo "\n\t";
|
||||
}
|
||||
|
||||
function footer(){
|
||||
//echo "\n\t";
|
||||
}
|
||||
|
||||
function options(){}
|
||||
|
||||
function get_plugin_directory(){
|
||||
return WP_PLUGIN_URL . '/jquery-vertical-accordion-menu';
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Include the widget
|
||||
include_once('dcwp_jquery_accordion_widget.php');
|
||||
|
||||
// Initialize the plugin.
|
||||
$dcjqaccordion = new dc_jqaccordion();
|
||||
|
||||
// Register the widget
|
||||
add_action('widgets_init', create_function('', 'return register_widget("dc_jqaccordion_widget");'));
|
||||
|
||||
?>
|
||||
@ -0,0 +1,321 @@
|
||||
<?php
|
||||
|
||||
class dc_jqaccordion_widget extends WP_Widget {
|
||||
/** constructor */
|
||||
function dc_jqaccordion_widget() {
|
||||
|
||||
$name = 'jQuery Accordion Menu';
|
||||
$desc = 'Vertical Accordion From Custom Menus';
|
||||
$id_base = 'dc_jqaccordion_widget';
|
||||
$widget_base = 'dc_jqaccordion_widget_item';
|
||||
$css_class = '';
|
||||
$alt_option = 'widget_dcjq_accordion_navigation';
|
||||
|
||||
$widget_ops = array(
|
||||
'classname' => $css_class,
|
||||
'description' => __( $desc, 'dcjq-accordion' ),
|
||||
);
|
||||
parent::WP_Widget( 'nav_menu', __('Custom Menu'), $widget_ops );
|
||||
|
||||
$this->WP_Widget($id_base, __($name, 'dcjqaccordion'), $widget_ops);
|
||||
$this->alt_option_name = $alt_option;
|
||||
|
||||
add_action( 'wp_head', array(&$this, 'styles'), 10, 1 );
|
||||
add_action( 'wp_footer', array(&$this, 'footer'), 10, 1 );
|
||||
|
||||
$this->defaults = array(
|
||||
'title' => '',
|
||||
'event' => 'click',
|
||||
'hoverDelay' => '300',
|
||||
'menuClose' => 'on',
|
||||
'autoClose' => 'on',
|
||||
'saveState' => 'on',
|
||||
'autoExpand' => 'off',
|
||||
'showCount' => 'off',
|
||||
'speed' => 'slow',
|
||||
'disableLink' => 'on',
|
||||
'classDisable' => 'on',
|
||||
'classMenu' => '',
|
||||
'skin' => 'demo.css'
|
||||
);
|
||||
}
|
||||
|
||||
function widget($args, $instance) {
|
||||
extract( $args );
|
||||
// Get menu
|
||||
|
||||
if(! isset($instance['speed']) ){ $instance['speed'] = 'slow'; }
|
||||
|
||||
$widget_options = wp_parse_args( $instance, $this->defaults );
|
||||
extract( $widget_options, EXTR_SKIP );
|
||||
|
||||
$nav_menu = wp_get_nav_menu_object( $instance['nav_menu'] );
|
||||
|
||||
if (!$nav_menu)
|
||||
return;
|
||||
|
||||
$instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
|
||||
|
||||
$classMenu = ($instance['classMenu'] != '') ? $instance['classMenu'] : 'menu';
|
||||
|
||||
echo $args['before_widget'];
|
||||
|
||||
if ( !empty($instance['title']) )
|
||||
echo $args['before_title'] . $instance['title'] . $args['after_title'];
|
||||
|
||||
?>
|
||||
|
||||
<div class="dcjq-accordion" id="<?php echo $this->id.'-item'; ?>">
|
||||
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'fallback_cb' => '',
|
||||
'menu' => $nav_menu,
|
||||
'container' => false,
|
||||
'menu_class' => $classMenu
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
echo $args['after_widget'];
|
||||
}
|
||||
|
||||
/** @see WP_Widget::update */
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance['title'] = strip_tags( stripslashes($new_instance['title']) );
|
||||
$instance['nav_menu'] = (int) $new_instance['nav_menu'];
|
||||
$instance['autoClose'] = $new_instance['autoClose'];
|
||||
$instance['menuClose'] = $new_instance['menuClose'];
|
||||
$instance['saveState'] = $new_instance['saveState'];
|
||||
$instance['autoExpand'] = $new_instance['autoExpand'];
|
||||
$instance['disableLink'] = $new_instance['disableLink'];
|
||||
$instance['classDisable'] = $new_instance['classDisable'];
|
||||
$instance['classMenu'] = $new_instance['classMenu'];
|
||||
$instance['showCount'] = $new_instance['showCount'];
|
||||
$instance['event'] = strip_tags( stripslashes($new_instance['event']) );
|
||||
$instance['skin'] = $new_instance['skin'];
|
||||
$instance['speed'] = $new_instance['speed'];
|
||||
$instance['hoverDelay'] = $new_instance['hoverDelay'];
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/** @see WP_Widget::form */
|
||||
function form($instance) {
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
|
||||
if(! isset($instance['autoClose']) ){ $instance['autoClose'] = 'false'; }
|
||||
if(! isset($instance['saveState']) ){ $instance['saveState'] = 'false'; }
|
||||
if(! isset($instance['menuClose']) ){ $instance['menuClose'] = 'false'; }
|
||||
if(! isset($instance['disableLink']) ){ $instance['disableLink'] = 'false'; }
|
||||
if(! isset($instance['classDisable']) ){ $instance['classDisable'] = ''; }
|
||||
if(! isset($instance['classMenu']) ){ $instance['classMenu'] = ''; }
|
||||
if(! isset($instance['autoExpand']) ){ $instance['autoExpand'] = 'false'; }
|
||||
if(! isset($instance['showCount']) ){ $instance['showCount'] = 'false'; }
|
||||
$event = isset( $instance['event'] ) ? $instance['event'] : '';
|
||||
$skin = isset( $instance['skin'] ) ? $instance['skin'] : '';
|
||||
$speed = isset( $instance['speed'] ) ? $instance['speed'] : '';
|
||||
$hoverDelay = isset( $instance['hoverDelay'] ) ? $instance['hoverDelay'] : '';
|
||||
|
||||
$widget_options = wp_parse_args( $instance, $this->defaults );
|
||||
extract( $widget_options, EXTR_SKIP );
|
||||
|
||||
// Get menus
|
||||
$menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );
|
||||
|
||||
// If no menus exists, direct the user to go and create some.
|
||||
if ( !$menus ) {
|
||||
echo '<p>'. sprintf( __('No menus have been created yet. <a href="%s">Create some</a>.'), admin_url('nav-menus.php') ) .'</p>';
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
||||
<input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" size="20" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:'); ?></label>
|
||||
<select id="<?php echo $this->get_field_id('nav_menu'); ?>" name="<?php echo $this->get_field_name('nav_menu'); ?>">
|
||||
<?php
|
||||
foreach ( $menus as $menu ) {
|
||||
$selected = $nav_menu == $menu->term_id ? ' selected="selected"' : '';
|
||||
echo '<option'. $selected .' value="'. $menu->term_id .'">'. $menu->name .'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<input type="radio" id="<?php echo $this->get_field_id('event1'); ?>" name="<?php echo $this->get_field_name('event'); ?>" value="click"<?php checked( $event, 'click' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('event1'); ?>"><?php _e( 'Click' , 'dcjq-accordion' ); ?></label>
|
||||
<input type="radio" id="<?php echo $this->get_field_id('event2'); ?>" name="<?php echo $this->get_field_name('event'); ?>" value="hover"<?php checked( $event, 'hover' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('event2'); ?>"><?php _e( 'Hover' , 'dcjq-accordion' ); ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" value="true" class="checkbox" id="<?php echo $this->get_field_id('autoClose'); ?>" name="<?php echo $this->get_field_name('autoClose'); ?>"<?php checked( $autoClose, 'true' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('autoClose'); ?>"><?php _e( 'Auto Close Open Menus' , 'dcjq-accordion' ); ?></label><br />
|
||||
|
||||
<input type="checkbox" value="true" class="checkbox" id="<?php echo $this->get_field_id('saveState'); ?>" name="<?php echo $this->get_field_name('saveState'); ?>"<?php checked( $saveState, 'true'); ?> />
|
||||
<label for="<?php echo $this->get_field_id('saveState'); ?>"><?php _e( 'Save Menu State (uses cookies)' , 'dcjq-accordion' ); ?></label><br />
|
||||
|
||||
<input type="checkbox" value="true" class="checkbox" id="<?php echo $this->get_field_id('autoExpand'); ?>" name="<?php echo $this->get_field_name('autoExpand'); ?>"<?php checked( $autoExpand, 'true' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('autoExpand'); ?>"><?php _e( 'Auto Expand Based on Current Page/Item' , 'dcjq-accordion' ); ?></label><br />
|
||||
|
||||
<input type="checkbox" value="true" class="checkbox" id="<?php echo $this->get_field_id('disableLink'); ?>" name="<?php echo $this->get_field_name('disableLink'); ?>"<?php checked( $disableLink, 'true' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('disableLink'); ?>"><?php _e( 'Disable Parent Links' , 'dcjq-accordion' ); ?></label><br />
|
||||
|
||||
<input type="checkbox" value="true" class="checkbox" id="<?php echo $this->get_field_id('menuClose'); ?>" name="<?php echo $this->get_field_name('menuClose'); ?>"<?php checked( $menuClose, 'true' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('menuClose'); ?>"><?php _e( 'Close Menu (hover only)' , 'dcjq-accordion' ); ?></label><br />
|
||||
|
||||
<input type="checkbox" value="true" class="checkbox" id="<?php echo $this->get_field_id('showCount'); ?>" name="<?php echo $this->get_field_name('showCount'); ?>"<?php checked( $showCount, 'true' ); ?> />
|
||||
<label for="<?php echo $this->get_field_id('showCount'); ?>"><?php _e( 'Show Count' , 'dcjq-accordion' ); ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('classMenu'); ?>"><?php _e('Menu Class:') ?></label>
|
||||
<input type="text" id="<?php echo $this->get_field_id('classMenu'); ?>" name="<?php echo $this->get_field_name('classMenu'); ?>" value="<?php echo $classMenu; ?>" size="15" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('classDisable'); ?>"><?php _e('Disable Class:') ?></label>
|
||||
<input type="text" id="<?php echo $this->get_field_id('classDisable'); ?>" name="<?php echo $this->get_field_name('classDisable'); ?>" value="<?php echo $classDisable; ?>" size="15" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('hoverDelay'); ?>"><?php _e('Hover Delay:', 'dcjq-accordion'); ?>
|
||||
<select name="<?php echo $this->get_field_name('hoverDelay'); ?>" id="<?php echo $this->get_field_id('hoverDelay'); ?>" >
|
||||
<option value='0' <?php selected( $hoverDelay, '0'); ?> >No Delay</option>
|
||||
<option value='200' <?php selected( $hoverDelay, '200'); ?> >0.2 sec</option>
|
||||
<option value='400' <?php selected( $hoverDelay, '400'); ?> >0.4 sec</option>
|
||||
<option value='600' <?php selected( $hoverDelay, '600'); ?> >0.6 sec</option>
|
||||
<option value='800' <?php selected( $hoverDelay, '800'); ?> >0.8 sec</option>
|
||||
<option value='1000' <?php selected( $hoverDelay, '1000'); ?> >1.0 sec</option>
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
<p><label for="<?php echo $this->get_field_id('speed'); ?>"><?php _e('Animation Speed:', 'dcjq-accordion'); ?>
|
||||
<select name="<?php echo $this->get_field_name('speed'); ?>" id="<?php echo $this->get_field_id('speed'); ?>" >
|
||||
<option value='slow' <?php selected( $speed, 'slow'); ?> >Slow</option>
|
||||
<option value='normal' <?php selected( $speed, 'normal'); ?> >Normal</option>
|
||||
<option value='fast' <?php selected( $speed, 'fast'); ?> >Fast</option>
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
<p><label for="<?php echo $this->get_field_id('skin'); ?>"><?php _e('Skin:', 'dcjq-accordion'); ?> <?php
|
||||
|
||||
// http://www.codewalkers.com/c/a/File-Manipulation-Code/List-files-in-a-directory-no-subdirectories/
|
||||
|
||||
echo "<select name='".$this->get_field_name('skin')."' id='".$this->get_field_id('skin')."'>";
|
||||
echo "<option value='no-theme' ".selected( $skin, 'no-theme', false).">No theme</option>";
|
||||
|
||||
//The path to the style directory
|
||||
$dirpath = plugin_dir_path(__FILE__) . 'skins/';
|
||||
|
||||
$dh = opendir($dirpath);
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
//Don't list subdirectories
|
||||
if (!is_dir("$dirpath/$file")) {
|
||||
//Remove file extension
|
||||
$newSkin = htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file)));
|
||||
echo "<option value='$newSkin' ".selected($skin, $newSkin, false).">" . $newSkin . '</option>';
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
echo "</select>"; ?> </label><br />
|
||||
</p>
|
||||
<div class="widget-control-actions alignright">
|
||||
<p><small><a href="http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/"><?php esc_attr_e('Visit plugin site', 'dcjq-accordion'); ?></a></small></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/** Adds ID based dropdown menu skin to the header. */
|
||||
function styles(){
|
||||
|
||||
if(!is_admin()){
|
||||
|
||||
$all_widgets = $this->get_settings();
|
||||
|
||||
foreach ($all_widgets as $key => $wpdcjqaccordion){
|
||||
$widget_id = $this->id_base . '-' . $key;
|
||||
|
||||
if(is_active_widget(false, $widget_id, $this->id_base)){
|
||||
|
||||
$skin = $wpdcjqaccordion['skin'];
|
||||
$skin = htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $skin)));
|
||||
if($skin != 'No-theme'){
|
||||
echo "\n\t<link rel=\"stylesheet\" href=\"".dc_jqaccordion::get_plugin_directory()."/skin.php?widget_id=".$key."&skin=".strtolower($skin)."\" type=\"text/css\" media=\"screen\" />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Adds ID based activation script to the footer */
|
||||
function footer(){
|
||||
|
||||
if(!is_admin()){
|
||||
|
||||
$all_widgets = $this->get_settings();
|
||||
|
||||
foreach ($all_widgets as $key => $wpdcjqaccordion){
|
||||
|
||||
$widget_id = $this->id_base . '-' . $key;
|
||||
|
||||
if(is_active_widget(false, $widget_id, $this->id_base)){
|
||||
|
||||
$autoClose = $wpdcjqaccordion['autoClose'];
|
||||
if($autoClose == ''){$autoClose = 'false';}
|
||||
|
||||
$saveState = $wpdcjqaccordion['saveState'];
|
||||
if($saveState == ''){$saveState = 'false';}
|
||||
|
||||
$disableLink = $wpdcjqaccordion['disableLink'];
|
||||
if($disableLink == ''){$disableLink = 'false';}
|
||||
|
||||
$classDisable = $wpdcjqaccordion['classDisable'];
|
||||
|
||||
$classMenu = $wpdcjqaccordion['classMenu'];
|
||||
if($classMenu == ''){$classMenu = 'menu';}
|
||||
|
||||
$menuClose = $wpdcjqaccordion['menuClose'];
|
||||
if($menuClose == ''){$menuClose = 'false';}
|
||||
|
||||
$autoExpand = $wpdcjqaccordion['autoExpand'];
|
||||
if($autoExpand == ''){$autoExpand = 'false';}
|
||||
|
||||
$showCount = $wpdcjqaccordion['showCount'];
|
||||
if($showCount == ''){$showCount = 'false';}
|
||||
|
||||
$hoverDelay = $wpdcjqaccordion['hoverDelay'];
|
||||
if($hoverDelay == ''){$hoverDelay = 600;}
|
||||
|
||||
$accordionId = '#'.$widget_id.'-item .'.$classMenu;
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery('<?php echo $accordionId; ?>').dcAccordion({
|
||||
eventType: '<?php echo $wpdcjqaccordion['event']; ?>',
|
||||
hoverDelay: <?php echo $hoverDelay; ?>,
|
||||
menuClose: <?php echo $menuClose; ?>,
|
||||
autoClose: <?php echo $autoClose; ?>,
|
||||
saveState: <?php echo $saveState; ?>,
|
||||
autoExpand: <?php echo $autoExpand; ?>,
|
||||
classExpand: 'current-menu-item',
|
||||
classDisable: '<?php echo $classDisable; ?>',
|
||||
showCount: <?php echo $showCount; ?>,
|
||||
disableLink: <?php echo $disableLink; ?>,
|
||||
cookie: '<?php echo $widget_id; ?>',
|
||||
speed: '<?php echo $wpdcjqaccordion['speed']; ?>'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // class dc_jqaccordion_widget
|
||||
@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a cookie with the given name and value and other optional parameters.
|
||||
*
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Set the value of a cookie.
|
||||
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
||||
* @desc Create a cookie with all available options.
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Create a session cookie.
|
||||
* @example $.cookie('the_cookie', null);
|
||||
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
||||
* used when the cookie was set.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @param String value The value of the cookie.
|
||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
||||
* when the the browser exits.
|
||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
||||
* require a secure protocol (like HTTPS).
|
||||
* @type undefined
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of a cookie with the given name.
|
||||
*
|
||||
* @example $.cookie('the_cookie');
|
||||
* @desc Get the value of a cookie.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @return The value of the cookie.
|
||||
* @type String
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
||||
}
|
||||
// CAUTION: Needed to parenthesize options.path and options.domain
|
||||
// in the following expressions, otherwise they evaluate to undefined
|
||||
// in the packed version for some reason...
|
||||
var path = options.path ? '; path=' + (options.path) : '';
|
||||
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else { // only name given, get cookie
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,213 @@
|
||||
/*
|
||||
* DC jQuery Vertical Accordion Menu - jQuery vertical accordion menu plugin
|
||||
* Copyright (c) 2011 Design Chemical
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
$.fn.dcAccordion = function(options) {
|
||||
//set default options
|
||||
var defaults = {
|
||||
classParent : 'dcjq-parent',
|
||||
classActive : 'active',
classArrow : 'dcjq-icon',
classCount : 'dcjq-count',
|
||||
classExpand : 'dcjq-current-parent',
|
||||
classDisable : '',
|
||||
eventType : 'click',
|
||||
hoverDelay : 300,
|
||||
menuClose : true,
|
||||
autoClose : true,
|
||||
autoExpand : false,
|
||||
speed : 'slow',
|
||||
saveState : true,
|
||||
disableLink : true,
showCount : false,
|
||||
cookie : 'dcjq-accordion'
|
||||
};
|
||||
//call in the default otions
|
||||
var options = $.extend(defaults, options);
|
||||
this.each(function(options){
|
||||
var obj = this;
|
||||
$objLinks = $('li > a',obj);
|
||||
$objSub = $('li > ul',obj);
|
||||
if(defaults.classDisable){
|
||||
$objLinks = $('li:not(.'+defaults.classDisable+') > a',obj);
|
||||
$objSub = $('li:not(.'+defaults.classDisable+') > ul',obj);
|
||||
}
|
||||
|
||||
classActive = defaults.classActive;
|
||||
|
||||
setUpAccordion();
|
||||
if(defaults.saveState == true){
|
||||
checkCookie(defaults.cookie, obj, classActive);
|
||||
}
|
||||
if(defaults.autoExpand == true){
|
||||
$('li.'+defaults.classExpand+' > a').addClass(classActive);
|
||||
}
|
||||
resetAccordion();
|
||||
if(defaults.eventType == 'hover'){
|
||||
var config = {
|
||||
sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
|
||||
interval: defaults.hoverDelay, // number = milliseconds for onMouseOver polling interval
|
||||
over: linkOver, // function = onMouseOver callback (REQUIRED)
|
||||
timeout: defaults.hoverDelay, // number = milliseconds delay before onMouseOut
|
||||
out: linkOut // function = onMouseOut callback (REQUIRED)
|
||||
};
|
||||
$objLinks.hoverIntent(config);
|
||||
var configMenu = {
|
||||
sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
|
||||
interval: 1000, // number = milliseconds for onMouseOver polling interval
|
||||
over: menuOver, // function = onMouseOver callback (REQUIRED)
|
||||
timeout: 1000, // number = milliseconds delay before onMouseOut
|
||||
out: menuOut // function = onMouseOut callback (REQUIRED)
|
||||
};
|
||||
$(obj).hoverIntent(configMenu);
|
||||
// Disable parent links
|
||||
if(defaults.disableLink == true){
|
||||
$objLinks.click(function(e){
|
||||
if($(this).siblings('ul').length >0){
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$objLinks.click(function(e){
|
||||
$activeLi = $(this).parent('li');
|
||||
$parentsLi = $activeLi.parents('li');
|
||||
$parentsUl = $activeLi.parents('ul');
|
||||
// Prevent browsing to link if has child links
|
||||
if(defaults.disableLink == true){
|
||||
if($(this).siblings('ul').length >0){
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
// Auto close sibling menus
|
||||
if(defaults.autoClose == true){
|
||||
autoCloseAccordion($parentsLi, $parentsUl);
|
||||
}
|
||||
if ($('> ul',$activeLi).is(':visible')){
|
||||
$('ul',$activeLi).slideUp(defaults.speed);
|
||||
$('a',$activeLi).removeClass(classActive);
|
||||
} else {
|
||||
$(this).siblings('ul').slideToggle(defaults.speed);
|
||||
$('> a',$activeLi).addClass(classActive);
|
||||
}
|
||||
// Write cookie if save state is on
|
||||
if(defaults.saveState == true){
|
||||
createCookie(defaults.cookie, obj, classActive);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Set up accordion
|
||||
function setUpAccordion(){
|
||||
$arrow = '<span class="'+defaults.classArrow+'"></span>';
|
||||
var classParentLi = defaults.classParent+'-li';
|
||||
$objSub.show();
|
||||
$('li',obj).each(function(){
|
||||
if($('> ul',this).length > 0){
$(this).addClass(classParentLi);
|
||||
$('> a',this).addClass(defaults.classParent).append($arrow);
|
||||
}
|
||||
});
|
||||
$objSub.hide();
|
||||
if(defaults.classDisable){
|
||||
$('li.'+defaults.classDisable+' > ul').show();
|
||||
}
|
||||
if(defaults.showCount == true){
|
||||
$('li.'+classParentLi,obj).each(function(){
|
||||
if(defaults.disableLink == true){
|
||||
var getCount = parseInt($('ul a:not(.'+defaults.classParent+')',this).length);
|
||||
} else {
|
||||
var getCount = parseInt($('ul a',this).length);
|
||||
}
|
||||
$('> a',this).append(' <span class="'+defaults.classCount+'">('+getCount+')</span>');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function linkOver(){
|
||||
|
||||
$activeLi = $(this).parent('li');
|
||||
$parentsLi = $activeLi.parents('li');
|
||||
$parentsUl = $activeLi.parents('ul');
|
||||
|
||||
// Auto close sibling menus
|
||||
if(defaults.autoClose == true){
|
||||
autoCloseAccordion($parentsLi, $parentsUl);
|
||||
|
||||
}
|
||||
|
||||
if ($('> ul',$activeLi).is(':visible')){
|
||||
$('ul',$activeLi).slideUp(defaults.speed);
|
||||
$('a',$activeLi).removeClass(classActive);
|
||||
} else {
|
||||
$(this).siblings('ul').slideToggle(defaults.speed);
|
||||
$('> a',$activeLi).addClass(classActive);
|
||||
}
|
||||
|
||||
// Write cookie if save state is on
|
||||
if(defaults.saveState == true){
|
||||
createCookie(defaults.cookie, obj, classActive);
|
||||
}
|
||||
}
|
||||
|
||||
function linkOut(){
|
||||
}
|
||||
|
||||
function menuOver(){
|
||||
}
|
||||
|
||||
function menuOut(){
|
||||
|
||||
if(defaults.menuClose == true){
|
||||
$objSub.slideUp(defaults.speed);
|
||||
// Reset active links
|
||||
$('a',obj).removeClass(classActive);
|
||||
createCookie(defaults.cookie, obj, classActive);
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-Close Open Menu Items
|
||||
function autoCloseAccordion($parentsLi, $parentsUl){
|
||||
$objSub.not($parentsUl).slideUp(defaults.speed);
|
||||
// Reset active links
|
||||
$('a',obj).removeClass(classActive);
|
||||
$('> a',$parentsLi).addClass(classActive);
|
||||
}
|
||||
// Reset accordion using active links
|
||||
function resetAccordion(){
|
||||
$objSub.hide();
|
||||
var $parentsLi = $('a.'+classActive,obj).parents('li');
|
||||
$('> a',$parentsLi).addClass(classActive);
|
||||
$allActiveLi = $('a.'+classActive,obj);
|
||||
$($allActiveLi).siblings('ul').show();
|
||||
}
|
||||
});
|
||||
// Retrieve cookie value and set active items
|
||||
function checkCookie(cookieId, obj, classActive){
|
||||
var cookieVal = $.cookie(cookieId);
|
||||
if(cookieVal != null){
|
||||
// create array from cookie string
|
||||
var activeArray = cookieVal.split(',');
|
||||
$.each(activeArray, function(index,value){
|
||||
var $cookieLi = $('li:eq('+value+')',obj);
|
||||
$('> a',$cookieLi).addClass(classActive);
|
||||
var $parentsLi = $cookieLi.parents('li');
|
||||
$('> a',$parentsLi).addClass(classActive);
|
||||
});
|
||||
}
|
||||
}
|
||||
// Write cookie
|
||||
function createCookie(cookieId, obj, classActive){
|
||||
var activeIndex = [];
|
||||
// Create array of active items index value
|
||||
$('li a.'+classActive,obj).each(function(i){
|
||||
var $arrayItem = $(this).parent('li');
|
||||
var itemIndex = $('li',obj).index($arrayItem);
|
||||
activeIndex.push(itemIndex);
|
||||
});
|
||||
// Store in cookie
|
||||
$.cookie(cookieId, activeIndex, { path: '/' });
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
|
||||
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
|
||||
*
|
||||
* @param f onMouseOver function || An object with configuration options
|
||||
* @param g onMouseOut function || Nothing (use configuration options object)
|
||||
* @author Brian Cherne <brian@cherne.net>
|
||||
*/
|
||||
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
|
||||
106
src/wp-content/plugins/jquery-vertical-accordion-menu/readme.txt
Normal file
@ -0,0 +1,106 @@
|
||||
=== JQuery Accordion Menu Widget ===
|
||||
Contributors: remix4
|
||||
Donate link: http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/#form-donate
|
||||
Tags: jquery, dropdown, menu, vertical accordion, animated, css, navigation, widget
|
||||
Requires at least: 3.0
|
||||
Tested up to: 3.13
|
||||
Stable tag: 2.6
|
||||
|
||||
Creates a widget, which allows you to create vertical accordion menus from any Wordpress custom menu using jQuery.
|
||||
|
||||
== Description ==
|
||||
|
||||
Creates a widget, which allows you to create vertical accordion menus from any Wordpress custom menu using jQuery. Features include - handles multiple levels, saved state using cookies, add count of number of links and option of selecting "click" or "hover" events for triggering the menu. Uses the jquery cookie plugin by [Klaus Hartl](http://www.stilbuero.de).
|
||||
|
||||
= Menu Options =
|
||||
|
||||
The widget has several parameters that can be configured to help cutomise the vertical accordion menu:
|
||||
|
||||
* Click/Hover - Selects the event type that will trigger the menu to open/close
|
||||
* Auto-close open menus - If checked this will allow only one menu item to be expanded at any time. Clicking on a new menu item will automatically close the previous one.
|
||||
* Save menu state (uses cookies) - Selecting this will allow the menu to remember its open/close state when browsing to a new page.
|
||||
* Auto Expand Based on Current Page/Item - If checked, this option will automatically expand sub-menus based on the current page/post based on the inherent Wordpress custom menu css classes - e.g. select this option if you would like the menu to automatically expand when the user clicks a link other than the accordion menu.
|
||||
* Disable parent links - If selected, any menu items that have child elements will have their links disabled and will only open/close their relevant sub-menus. Do not select this if you want the user to still be able to browse to that item's page.
|
||||
* Close menu (hover only) - If checked the menu will automatically fully close after 1 second when the mouse moves off the menu - only available if event type is "hover"
|
||||
* Show Count - If checked the menu will automatically add a count showing the number of links under each parent menu item
|
||||
* Class Menu - Set the CSS class of the Wordpress menu. If blank the default class "menu" will be used
|
||||
* Class Disable - Input the CSS class for parent menu items that should be disabled - i.e. the child sub-menu remains open
|
||||
* Hover delay - This setting adds a delay to the hover event to help prevent the menu opening/closing accidentally. A higher number means the cursor must stop moving for longer before the menu action will trigger
|
||||
* Animation Speed - The speed at which the menu will open/close
|
||||
* Skin - Several sample skins are available to give examples of css that can be used to style your accordion menu
|
||||
|
||||
Note: care should be taken when selecting the hover event as this may impact useability - adding a hover delay and reducing the animation speed may help reduce problems with useability
|
||||
|
||||
[__See Demo__](http://www.designchemical.com/lab/demo-wordpress-vertical-accordion-menu-plugin/)
|
||||
[__Plugin Home Page__](http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/)
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload the plugin through `Plugins > Add New > Upload` interface or upload `jquery-vertical-accordion-menu` folder to the `/wp-content/plugins/` directory
|
||||
2. Activate the plugin through the 'Plugins' menu in WordPress
|
||||
3. In the widgets section, select the jQuery accordion menu widget and add to one of your widget areas
|
||||
4. Select one of the WP menus, set the required settings and save your widget
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= The menu appears on the page but does not work. Why? =
|
||||
|
||||
First - make sure that your custom menu has at least 2 levels. If it has only one level the open/close effect is not active.
|
||||
|
||||
One main reason for the menu failing to load properly is caused by the necessary code missing from the page footer. The plugin adds the required jQuery code to your template footer. Make sure that your template files contain the wp_footer() function.
|
||||
|
||||
Another likely cause is due to other non-functioning plugins, which may have errors and cause the plugin javascript to not load. Remove any unwanted plugins and try again. Checking with Firebug will show where these error are occuring.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Widget in edit mode
|
||||
2. Sample vertical accordion menus
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.6 =
|
||||
* Added: Ability to disable parent menu items using a CSS class
|
||||
* Added: Ability to set menu CSS Class - default "menu"
|
||||
* Update: Revision to auto-expand system
|
||||
* Update: jquery.dcjqaccordion.2.8.js
|
||||
|
||||
= 2.5.4 =
|
||||
* Fix: Bug with save state option
|
||||
|
||||
= 2.5.3 =
|
||||
* Added: jQuery accordion plugin includes check for cookie function
|
||||
|
||||
= 2.5.2 =
|
||||
* Update: jquery.dcjqaccordion.2.7.js - fix bug with count option
|
||||
|
||||
= 2.5.1 =
|
||||
* Fix: Bug when using "No Theme" option
|
||||
|
||||
= 2.5 =
|
||||
* Added: Auto-expand now independent of save state option
|
||||
|
||||
= 2.4 =
|
||||
* Added: Ability to auto-expand menu based on the Wordpress current page/menu item classes
|
||||
|
||||
= 2.3 =
|
||||
* Edit: Plugin now works with Cufon text
|
||||
|
||||
= 2.2 =
|
||||
* Added: Option to show count of number of child links
|
||||
* Edit: Plugin updated to use jquery plugin version 2.3
|
||||
* Edit: Cookie name set based on widget ID
|
||||
|
||||
= 2.1 =
|
||||
* Edit: Security for dynamic skins
|
||||
|
||||
= 2.0 =
|
||||
* Added : Ability to select either hover or click to activate menu
|
||||
* Added : Hover delay setting for hover event
|
||||
* Added : Close menu option for hover event
|
||||
|
||||
= 1.1 =
|
||||
* Fixed : Duplicate ID with themes adding ID to widget container
|
||||
* Fixed : Set cookie path
|
||||
|
||||
= 1.0 =
|
||||
* First release
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
header("Content-type: text/css");
|
||||
|
||||
$id = $_GET['widget_id'];
|
||||
$id = clean($id);
|
||||
$skin = $_GET['skin'];
|
||||
$skin = clean($skin);
|
||||
if(!empty($skin)){
|
||||
$skin .= '.css';
|
||||
$css = file_get_contents('./skins/' . $skin );
|
||||
$widget_skin = preg_replace('/%ID%/',$id, $css);
|
||||
echo $widget_skin;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
function clean($str = '', $html = false) {
|
||||
if (empty($str)) return;
|
||||
|
||||
if (is_array($str)) {
|
||||
foreach($str as $key => $value) $str[$key] = clean($value, $html);
|
||||
} else {
|
||||
if (get_magic_quotes_gpc()) $str = stripslashes($str);
|
||||
|
||||
if (is_array($html)) $str = strip_tags($str, implode('', $html));
|
||||
elseif (preg_match('|<([a-z]+)>|i', $html)) $str = strip_tags($str, $html);
|
||||
elseif ($html !== true) $str = strip_tags($str);
|
||||
|
||||
$str = trim($str);
|
||||
$str = str_replace(".", "", $str);
|
||||
$str = str_replace("/", "", $str);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,7 @@
|
||||
#dc_jqaccordion_widget-%ID%-item{font: bold 13px Arial, sans-serif;}
|
||||
#dc_jqaccordion_widget-%ID%-item ul, #dc_jqaccordion_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
|
||||
#dc_jqaccordion_widget-%ID%-item ul a {padding: 10px 10px 10px 28px; background: #000 url(skins/images/bg_graphite.png) repeat-x 0 0; text-decoration:none; display: block; color: #fff; font-weight: normal;border-bottom: 1px solid #fff;}
|
||||
#dc_jqaccordion_widget-%ID%-item ul ul a {background: #343434;}
|
||||
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent, #dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent:hover {background: #000 url(skins/images/graphite_arrow_right.png) no-repeat 0 0; font-weight: bold; color: #fff;}
|
||||
#dc_jqaccordion_widget-%ID%-item ul a.dcjq-parent.active {background: #000 url(skins/images/graphite_arrow_down.png) no-repeat 0 0;}
|
||||
#dc_jqaccordion_widget-%ID%-item ul a:hover {background: #121212;}
|
||||