From 58760602ab94f4ec443a2d42aa69a153d0e45b88 Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Fri, 16 Dec 2005 16:55:29 +0000 Subject: add missing files - moving out from admin --- newsletters.php | 69 +++++++++++++++++++++++++ templates/list_newsletters.tpl | 113 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 newsletters.php create mode 100644 templates/list_newsletters.tpl diff --git a/newsletters.php b/newsletters.php new file mode 100644 index 0000000..9cf1d19 --- /dev/null +++ b/newsletters.php @@ -0,0 +1,69 @@ +verifyPackage( 'newsletters' ); +$gBitSystem->verifyPermission( 'tiki_p_admin_newsletters' ); + +require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_inc.php' ); + +if( isset( $_REQUEST["remove"] ) && $gContent->isValid() ) { + if( !empty( $_REQUEST['cancel'] ) ) { + // user cancelled - just continue on, doing nothing + } elseif( empty( $_REQUEST['confirm'] ) ) { + $formHash['remove'] = TRUE; + $formHash['nl_id'] = $gContent->mNlId; + $gBitSystem->confirmDialog( $formHash, array( 'warning' => 'Are you sure you want to delete the newsletter '.$gContent->getTitle().'?' ) ); + } else { + if( $gContent->expunge() ) { + header( "Location: ".NEWSLETTERS_PKG_URL.'admin/' ); + die; + } + } +} elseif (isset($_REQUEST["save"])) { + $sid = $gContent->store( $_REQUEST ); + header( "Location: ".$_SERVER['PHP_SELF'] ); + die; +} + +$gContent->invokeServices( 'content_edit_function' ); + +// Configure quicktags list +if ($gBitSystem->isPackageActive( 'quicktags' ) ) { + include_once( QUICKTAGS_PKG_PATH.'quicktags_inc.php' ); +} + +$newsletters = $gContent->getList( $listHash ); +$gBitSmarty->assign_by_ref( 'newsletters', $newsletters ); +$gBitSmarty->assign_by_ref( 'listInfo', $listHash ); + +// Fill array with possible number of questions per page +/* +$freqs = array(); + +for ($i = 0; $i < 90; $i++) { + $aux["i"] = $i; + + $aux["t"] = $i * 24 * 60 * 60; + $freqs[] = $aux; +} + +$gBitSmarty->assign('freqs', $freqs); +*/ +/* +$cat_type='newsletter'; +$cat_objid = $_REQUEST["nl_id"]; +include_once( CATEGORIES_PKG_PATH.'categorize_list_inc.php' ); +*/ + +// Display the template +$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl'); + +?> diff --git a/templates/list_newsletters.tpl b/templates/list_newsletters.tpl new file mode 100644 index 0000000..3b43512 --- /dev/null +++ b/templates/list_newsletters.tpl @@ -0,0 +1,113 @@ +{strip} +
{bithelp}
+ +
+
+

{tr}Newsletter Settings{/tr}

+
+ +
+ {if !$newsletters || $gContent->isValid() || $smarty.request.new} + {form legend="Create / Edit Newsletters"} + {if $individual eq 'y'} + {tr}There are individual permissions set for this newsletter{/tr}

+ {/if} + + +
+ {formlabel label="Title" for="title"} + {forminput} + + {formhelp note="Title of the newsletter."} + {/forminput} +
+ +
+ {formlabel label="Description" for="description"} + {forminput} + + {formhelp note="Description of the newsletter, that users know what they are getting themselves into."} + {/forminput} +
+ +
+ {formlabel label="Users can Subscribe" for="allow_user_sub"} + {forminput} + mInfo.allow_user_sub eq 'y'}checked="checked"{/if} /> + {formhelp note="Users can subscribe to this list. Disabling this options means that you have to manually add users to the list."} + {/forminput} +
+ +
+ {formlabel label="Any e-mail Address" for="allow_any_sub"} + {forminput} + mInfo.allow_any_sub eq 'y'}checked="checked"{/if} /> + {formhelp note="Users may subscribe using any email address."} + {/forminput} +
+ +
+ {formlabel label="Append Un/Subscribe Instructions" for="unsub_msg"} + {forminput} + mInfo.unsub_msg eq 'y'}checked="checked"{/if} /> + {formhelp note="Append instructions on how to subscribe / unsubscribe to ever outgoing newsletter. This is only useful when users can un / subscribe to the list themselves."} + {/forminput} +
+ +
+ {formlabel label="Validate e-mail Addresses" for="validate_addr"} + {forminput} + mInfo.validate_addr eq 'y'}checked="checked"{/if} /> + {formhelp note="Validate all email addresses before they are added to the list. This might result in members not being added despite working email addresses."} + {/forminput} +
+ +
+ + +
+ {/form} + + {else} + + {minifind} + + + + + + + + + + + + + {foreach key=nlId from=$newsletters item=nl} + + + + + + + + + {foreachelse} + + + + {/foreach} +
{tr}Newsletters{/tr}
{smartlink ititle="Name" isort=name offset=$offset}{smartlink ititle="Description" isort=description offset=$offset}{smartlink ititle="Created" isort=last_sent offset=$offset}{smartlink ititle="Last Sent" isort=created offset=$offset}{smartlink ititle="Users Unsubscribed" isort=users offset=$offset}{tr}Action{/tr}
{$nl.title}{$nl.data}{$nl.created|bit_short_date}{$nl.last_sent|bit_short_date}{$nl.users|default:0} [ {$channels[user].confirmed|default:0} ] + {biticon ipackage=liberty iname=new iexplain="New Edition"} + {biticon ipackage=liberty iname=delete iexplain=Remove} + {biticon ipackage=liberty iname=edit iexplain=Edit} + {if $channels[user].individual eq 'y'}({/if}{biticon ipackage=liberty iname=permissions iexplain=Permissions}{if $nl.individual eq 'y'}){/if} +
{tr}No Records Found{/tr}
+ + Create new newsletter + + {pagination} + {/if} +
+
+{/strip} -- cgit v1.3