Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / postcalendar [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 03 Oct 2002 03:48:01 | postnuke_modules/postcalendar | pcSmarty.class.php,1.1,1.2 pnadmin.php,1.33,1.34 smarty_plugins.php,1.7,1.8 | Roger Raymond |
| template selection in admin, view selection in views (started) | |||
Update of /home/cvsroot/postnuke_modules/postcalendar
In directory ns7.hostnuke.net:/tmp/cvs-serv2052
Modified Files:
pcSmarty.class.php pnadmin.php smarty_plugins.php
Log Message:
template selection in admin, view selection in views (started)
Index: pcSmarty.class.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pcSmarty.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pcSmarty.class.php 2 Oct 2002 21:15:11 -0000 1.1
--- pcSmarty.class.php 3 Oct 2002 03:47:58 -0000 1.2
***************
*** 30,34 ****
--- 30,36 ----
$this->register_function('pc_event_url','postcalendar_smarty_pcEventURL');
$this->register_function('pc_date_select','postcalendar_smarty_pcDateSelect');
+ $this->register_function('pc_view_select','postcalendar_smarty_showViews');
$this->register_function('pc_url','postcalendar_smarty_pcURL');
+
$this->register_modifier('pc_date_format','postcalendar_smarty_pc_date_format');
// assign theme globals
Index: pnadmin.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnadmin.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** pnadmin.php 2 Oct 2002 23:30:18 -0000 1.33
--- pnadmin.php 3 Oct 2002 03:47:58 -0000 1.34
***************
*** 1560,1563 ****
--- 1560,1585 ----
$settings[$i++][] = $output->FormCheckBox('usepopups', pnModGetVar('PostCalendar','usepopups'));
+ $templatelist = array();
+ $handle = opendir('modules/PostCalendar/pntemplates');
+ while($f=readdir($handle))
+ { if ($f != '.' && $f != '..' && $f != 'CVS'
+ && $f != 'compiled' && $f != 'cache' && !ereg("[.]",$f)) {
+ $templatelist[] = $f;
+ }
+ }
+ closedir($handle);
+ sort($templatelist);
+ $tcount = count($templatelist);
+ $settings[$i][] = $output->Text(_PC_DEFAULT_TEMPLATE);
+ $options = array();
+ $selected = pnModGetVar('PostCalendar','pcTemplate');
+ for($t=0;$t<$tcount;$t++) {
+ $options[$t]['id'] = $templatelist[$t];
+ $options[$t]['selected'] = ($selected == $templatelist[$t]);
+ $options[$t]['name'] = $templatelist[$t];
+ }
+ $settings[$i++][] = $output->FormSelectMultiple('pcTemplate', $options);
+
+
$output->SetOutputMode(_PNH_KEEPOUTPUT);
***************
*** 1595,1599 ****
$listhowmanyevents,
$displaytopics,
! $pcEventDateFormat) = pnVarCleanFromInput('time24hours',
'eventsopeninnewwindow',
'useinternationaldates',
--- 1617,1622 ----
$listhowmanyevents,
$displaytopics,
! $pcEventDateFormat,
! $pcTemplate) = pnVarCleanFromInput('time24hours',
'eventsopeninnewwindow',
'useinternationaldates',
***************
*** 1605,1609 ****
'listhowmanyevents',
'displaytopics',
! 'pcEventDateFormat');
// make sure we enter something into the DB
--- 1628,1633 ----
'listhowmanyevents',
'displaytopics',
! 'pcEventDateFormat',
! 'pcTemplate');
// make sure we enter something into the DB
***************
*** 1619,1622 ****
--- 1643,1647 ----
if(!isset($displaytopics)) { $displaytopics='0'; }
if(!isset($pcEventDateFormat)) { $pcEventDateFormat='%m/$d/%Y'; }
+ if(!isset($pcTemplate)) { $pcTemplate='default'; }
pnModSetVar('PostCalendar', 'time24hours', $time24hours);
***************
*** 1631,1635 ****
pnModSetVar('PostCalendar', 'displaytopics', $displaytopics);
pnModSetVar('PostCalendar', 'pcEventDateFormat', $pcEventDateFormat);
!
$output->Text('<center>'._PC_UPDATED.'</center>');
--- 1656,1660 ----
pnModSetVar('PostCalendar', 'displaytopics', $displaytopics);
pnModSetVar('PostCalendar', 'pcEventDateFormat', $pcEventDateFormat);
! pnModSetVar('PostCalendar', 'pcTemplate', $pcTemplate);
$output->Text('<center>'._PC_UPDATED.'</center>');
Index: smarty_plugins.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/smarty_plugins.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** smarty_plugins.php 2 Oct 2002 19:32:11 -0000 1.7
--- smarty_plugins.php 3 Oct 2002 03:47:58 -0000 1.8
***************
*** 174,180 ****
$useinternationaldate = pnModGetVar('PostCalendar','useinternationaldates');
list($Date,$d,$m,$y) = pnVarCleanFromInput('Date','jumpday','jumpmonth','jumpyear');
! if(isset($Date)) {
! list($m,$d,$y) = explode('/',$Date);
! }
if(!isset($args['day']) || strtolower($args['day']) == 'on') {
$args['day'] = true;
--- 174,184 ----
$useinternationaldate = pnModGetVar('PostCalendar','useinternationaldates');
list($Date,$d,$m,$y) = pnVarCleanFromInput('Date','jumpday','jumpmonth','jumpyear');
! if(!isset($Date)) {
! $Date = postcalendar_getDate();
! }
! $y = substr($Date,0,4);
! $m = substr($Date,4,2);
! $d = substr($Date,6,2);
!
if(!isset($args['day']) || strtolower($args['day']) == 'on') {
$args['day'] = true;
***************
*** 256,258 ****
--- 260,339 ----
}
+ function postcalendar_smarty_showViews($args)
+ {
+ if(!isset($args['form']) || strtolower($args['form']) == 'on') {
+ $args['form'] = true;
+ } else {
+ $args['form'] = false;
+ }
+
+ list($Date,$d,$m,$y) = pnVarCleanFromInput('Date','jumpday','jumpmonth','jumpyear');
+ if(!isset($Date)) {
+ $Date = postcalendar_getDate();
+ }
+ $y = substr($Date,0,4);
+ $m = substr($Date,4,2);
+ $d = substr($Date,6,2);
+
+ $tplview = pnVarCleanFromInput('tplview');
+ $viewtype = pnVarCleanFromInput('viewtype');
+
+ $output = new pnHTML();
+ $output->SetOutputMode(_PNH_RETURNOUTPUT);
+
+ $modinfo = pnModGetInfo(pnModGetIDFromName('PostCalendar'));
+ $mdir = pnVarPrepForOS($modinfo['directory']);
+ $pcTemplate = pnVarPrepForOS(pnModGetVar('PostCalendar','pcTemplate'));
+
+ $viewlist = array();
+ $cdir = getcwd().'/modules/'.$mdir.'/pntemplates/'.$pcTemplate.'/views/'.$viewtype;
+ $dir = dir($cdir);
+ while($file = $dir->read()) {
+ if($file != 'index.html' && $file != '.' && $file != '..' && $file != 'CVS') {
+ $viewlist[] = $file;
+ }
+ }
+ sort($viewlist);
+ $tcount = count($viewlist);
+ $options = array();
+ $selected = $tplview;
+ for($t=0;$t<$tcount;$t++) {
+ $options[$t]['id'] = str_replace('.html','',$viewlist[$t]);
+ $options[$t]['selected'] = ($selected == str_replace('.html','',$viewlist[$t]));
+ $options[$t]['name'] = str_replace('.html','',$viewlist[$t]);
+ }
+
+ if(!isset($args['label'])) $args['label'] = _PC_TPL_VIEW_SUBMIT;
+ $submit = '<input type="submit" valign="middle" name="submit" value="'.$args['label'].'" />';
+ if($args['form'] === true) {
+ $fstart = $output->FormStart(pnModURL('PostCalendar','user','view'));
+ $fend = $output->FormEnd();
+ }
+
+ // build the form
+ echo $fstart;
+ echo $output->FormSelectMultiple('tplview', $options);
+ echo $submit;
+ echo $fend;
+ }
+
+ function list_dir($file_name_convention)
+ {
+ switch ($file_name_convention) {
+ case 'dated_reports':
+ //matches files like '5_23_2002.html'
+ $this_regexp = "/[0-9]{1,}_[0-9]{1,}_[0-9]{4,}/";
+ break;
+ //add more cases of file name conventions
+ }
+ $this_dir = dir('.');
+ if ($this_regexp != null) {
+ while ($file = $this_dir->read()) {
+ if (preg_match($this_regexp, $file)) {
+ $result_array[] = $file;
+ }
+ }
+ }
+ return $result_array;
+ }
?>
View Statistics - Next Notice - Previous Notice
| Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |