Skip to content

Commit

Permalink
v115
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Belelieu authored and Jon Belelieu committed May 18, 2017
1 parent 860ad29 commit 17480ea
Show file tree
Hide file tree
Showing 123 changed files with 2,125 additions and 244 deletions.
22 changes: 22 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ RewriteRule ^(.*)$ login.php [F,L]
# ---------------------------------------------------------
# Main rewrites

# Clean links for standard pages
RewriteRule ^cart/?$ cart.php [NC,QSA,L]
RewriteRule ^login/?$ login.php [NC,QSA,L]
RewriteRule ^logout/?$ logout.php [NC,QSA,L]
RewriteRule ^events/view/(.*)/(.*)/?$ event.php?id=$2 [NC,QSA,L]
RewriteRule ^events/(.*)/(.*)/?$ calendar.php?id=$2 [NC,QSA,L]
RewriteRule ^manage/billing?$ manage/billing_history.php [NC,QSA,L]
RewriteRule ^manage/credit_cards?$ manage/credit_cards.php [NC,QSA,L]
RewriteRule ^manage/events_attended?$ manage/events.php [NC,QSA,L]
RewriteRule ^manage/files?$ manage/uploads.php [NC,QSA,L]
RewriteRule ^manage/invoices?$ manage/invoices.php [NC,QSA,L]
RewriteRule ^manage/member_news?$ manage/announcements.php [NC,QSA,L]
RewriteRule ^manage/subscriptions?$ manage/subscriptions.php [NC,QSA,L]
RewriteRule ^manage/update?$ manage/update_account.php [NC,QSA,L]
RewriteRule ^news/(.*)/(.*)/?$ news.php?id=$2 [NC,QSA,L]
RewriteRule ^register/(.*)/(.*)/?$ register.php?id=$2&action=reset [NC,QSA,L]
RewriteRule ^register/?$ register.php?action=reset [NC,QSA,L]
RewriteRule ^shop/view/(.*)/(.*)/?$ catalog.php?id=$2 [NC,QSA,L]
RewriteRule ^shop/(.*)/(.*)/?$ catalog.php?category=$2 [NC,QSA,L]


# All Others
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?in=$1 [L,QSA]
Expand Down
36 changes: 36 additions & 0 deletions admin/cp-classes/OptionsContract.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
*
*
* Zenbership Membership Software
* Copyright (C) 2013-2016 Castlamp, LLC
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* @author Castlamp
* @link http://www.castlamp.com/
* @link http://www.zenbership.com/
* @copyright (c) 2013-2016 Castlamp
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
* @project Zenbership Membership Software
*/

interface OptionsContract {

public function processValue($key);

public function processGet($key);

}
2 changes: 1 addition & 1 deletion admin/cp-classes/admin.class.php

Large diffs are not rendered by default.

94 changes: 86 additions & 8 deletions admin/cp-classes/adminFields.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ class adminFields {

private $richtexts = 0;

private $label = '';
private $leftText = '';
private $filterType = '';
private $rightText = '';
private $description = '';
private $typeOverride = '';
private $selectOptions = array();
private $id;
private $min, $max, $maxlength;
private $placeholder;
Expand All @@ -58,6 +61,13 @@ public function setMax($max)
return $this;
}

public function setSelectOptions(array $options)
{
$this->selectOptions = $options;

return $this;
}

public function setAutocomplete($auto)
{
$this->autocomplete = $auto;
Expand Down Expand Up @@ -125,6 +135,22 @@ public function setSpecialType($type)
return $this;
}

public function setFilter($filter)
{
$this->filterType = $filter;

return $this;
}


public function setLabel($name)
{
$this->label = $name;

return $this;
}


public function setRightText($text)
{
$this->rightText = $text;
Expand Down Expand Up @@ -159,6 +185,10 @@ public function sendBack($string)

$send = '';

if (! empty($this->label)) {
$send .= '<label>' . $this->label . '</label>';
}

if ($this->fieldBox && ! empty($this->description)) {
$send .= '<div class="fieldBox">';
}
Expand Down Expand Up @@ -222,6 +252,10 @@ public function sendBack($string)
*/
public function wrap($field, $displayName = '', $description = '')
{
if (! empty($this->label)) {
$displayName = $this->label;
}

$return = '<div class="field">
<label class="top">' . $displayName . '</label>
<div class="field_entry_top">' . $field . '</div>';
Expand Down Expand Up @@ -274,6 +308,10 @@ public function select($fieldName, $val = '', $options = array(), $style = '')
{
$id = $this->getId();

if (! empty($this->selectOptions)) {
$options = $this->selectOptions;
}

$return = '<select id="' . $id . '" name="' . $fieldName . '"';
if (! empty($style)) {
$return .= ' style="' . $style . '"';
Expand Down Expand Up @@ -628,7 +666,7 @@ public function formList($fieldName, $val = '', $class = '')
$this->rightText = "<a href=\"null.php\" onclick=\"return get_list('forms','" . $id . "_id','" . $id . "');\"><img
src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing the form's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing the form's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"form_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','name','ppSD_forms','name','forms');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
Expand Down Expand Up @@ -656,7 +694,7 @@ public function contentList($fieldName, $val = '', $class = '')
$this->rightText = "<a href=\"null.php\" onclick=\"return get_list('content','" . $id . "_id','" . $id . "');\"><img
src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing the content's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing the content's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"content_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','name','ppSD_content','name','content');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
Expand Down Expand Up @@ -685,7 +723,7 @@ public function memberTypeList($fieldName, $val = '', $class = '')
$this->rightText = "<a href=\"null.php\" onclick=\"return get_list('member_types','" . $id . "_id','" . $id . "');\"><img
src=\"imgs/icon-list.png\" class=\"icon\" width=16 height=16 alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing a member type or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing a member type or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"member_type_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','name','ppSD_member_types','name','member_types');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
Expand Down Expand Up @@ -714,12 +752,39 @@ public function staffList($fieldName, $val = '', $class = '')
$this->rightText = "<a href=\"null.php\" onclick=\"return get_list('staff','" . $id . "_id','" . $id . "');\"><img
src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing an employee's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing an employee's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"staff_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','username','ppSD_staff','username,first_name,last_name','staff');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
}

/**
* @param $fieldName
* @param string $val
* @param string $class
*
* @return string
*/
public function fieldList($fieldName, $val = '', $class = '')
{
$id = $this->getId();

if (! empty($val)) {
$field = new field;
$get = $field->get_field_name($val);
} else {
$name = '';
}

$this->rightText = "<a href=\"null.php\" onclick=\"return get_list('fields','" . $id . "_id','" . $id . "');\"><img
src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing a field name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"staff_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','display_name','ppSD_fields','display_name','fields');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
}



public function sourceList($fieldName, $val = '', $class = '', $addButton = true)
Expand All @@ -742,17 +807,29 @@ public function sourceList($fieldName, $val = '', $class = '', $addButton = true
<img src=\"imgs/icon-quickadd.png\" alt=\"Add\" title=\"Add\" /></a>";
}

return $this->sendBack("<input placeholder=\"Begin typing a source or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing a source or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"source_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','source','ppSD_sources','source','sources');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
}


/**
* @param $fieldName
* @param string $val
* @param string $class
* @param string $filter
*
* @return string
*/
public function productList($fieldName, $val = '', $class = '', $filter = '')
{
$id = $this->getId();

if (! empty($this->filterType)) {
$filter = $this->filterType;
}

if (! empty($val)) {
$product = new product;
$name = $product->get_name($val);
Expand Down Expand Up @@ -781,6 +858,7 @@ public function productList($fieldName, $val = '', $class = '', $filter = '')




public function couponList($fieldName, $val = '', $class = '')
{
$id = $this->getId();
Expand Down Expand Up @@ -814,7 +892,7 @@ public function accountList($fieldName, $val = '', $class = '')
src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a><a href=\"null.php\" onclick=\"return popup('account-add','');\">
<img src=\"imgs/icon-quickadd.png\" alt=\"Add\" title=\"Add\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing the account's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing the account's name or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"account_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','name','ppSD_accounts','name','accounts');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
Expand All @@ -841,7 +919,7 @@ public function labelList($fieldName, $val = '', $class = '')
$this->rightText = "<a href=\"null.php\" onclick=\"return get_list('labels','" . $id . "_id','" . $id . "');\"><img
src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing the label or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing the label or click the list icon to the right...\" type=\"text\" value=\"" . $name . "\" name=\"upload_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'label','label','ppSD_uploads','label','uploads');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
Expand All @@ -867,7 +945,7 @@ public function transactionList($fieldName, $val = '', $class = '')

// $this->rightText = "<a href=\"null.php\" onclick=\"return get_list('labels','" . $id . "_id','" . $id . "');\"><img src=\"imgs/icon-list.png\" alt=\"Select from list\" title=\"Select from list\" /></a>";

return $this->sendBack("<input placeholder=\"Begin typing a transaction ID to select...\" type=\"text\" value=\"" . $name . "\" name=\"product_dud\" id=\"" . $id . "\"
return $this->sendBack("<input placeholder=\"Begin typing a transaction ID to select...\" type=\"text\" value=\"" . $name . "\" name=\"order_dud\" id=\"" . $id . "\"
autocomplete=\"off\" onkeyup=\"return autocom(this.id,'id','id','ppSD_cart_sessions','id','transactions');\"
style=\"\" class=\"" . $class . "\" /><input type=\"hidden\" name=\"$fieldName\" id=\"" . $id . "_id\"
value=\"" . $val . "\" />");
Expand Down
2 changes: 1 addition & 1 deletion admin/cp-classes/cart.class.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/cp-classes/criteria.class.php

Large diffs are not rendered by default.

Loading

0 comments on commit 17480ea

Please sign in to comment.