/** * Event handler: SkinTag (widget) * * @param array Associative array of parameters. Valid keys are: * - 'block_start' : (Default: '<div class="bSideItem">') * - 'block_end' : (Default: '</div>') * - 'title' : (Default: T_('Calendar')) * - 'displaycaption' * - 'monthformat' * - 'linktomontharchive' * - 'tablestart' * - 'tableend' * - 'monthstart' * - 'monthend' * - 'rowstart' * - 'rowend' * - 'headerdisplay' * - 'headerrowstart' * - 'headerrowend' * - 'headercellstart' * - 'headercellend' * - 'cellstart' * - 'cellend' * - 'linkpostcellstart' * - 'linkposttodaycellstart' * - 'todaycellstart' * - 'todaycellstartpost' * - 'navigation' : Where do we want to have the navigation arrows? (Default: 'tfoot') * - 'browseyears' : boolean Do we want arrows to move one year at a time? * - 'min_timestamp' : Minimum unix timestamp the user can browse too or 'query' (Default: 2000-01-01) * - 'max_timestamp' : Maximum unix timestamp the user can browse too or 'query' (Default: now + 1 year ) * - 'postcount_month_atitle' * - 'postcount_month_atitle_one' * - 'postcount_year_atitle' * - 'postcount_year_atitle_one' * - 'link_type' : 'canonic'|'context' (default: canonic) * @return boolean did we display? */ function SkinTag($params) { // Prefix of the ItemList object $itemlist_prefix = isset($params['itemlist_prefix']) ? $params['itemlist_prefix'] : ''; global $month; global $Blog, $cat_array, $cat_modifier; global $show_statuses; global $author, $assgn, $status, $types; global ${$itemlist_prefix . 'm'}, $w, $dstart; global $s, $sentence, $exact; global $posttypes_specialtypes; /** * Default params: */ // This is what will enclose the block in the skin: if (!isset($params['block_start'])) { $params['block_start'] = '<div class="bSideItem">'; } if (!isset($params['block_end'])) { $params['block_end'] = "</div>\n"; } // Title: if (!isset($params['block_title_start'])) { $params['block_title_start'] = '<h3>'; } if (!isset($params['block_title_end'])) { $params['block_title_end'] = '</h3>'; } if (!isset($params['title'])) { $params['title'] = ''; } $Calendar = new Calendar(${$itemlist_prefix . 'm'}, $params); // TODO: automate with a table inside of Calendatr object. Table should also contain descriptions and default values to display in help screen. // Note: minbrowse and maxbrowe already work this way. if (isset($params['displaycaption'])) { $Calendar->set('displaycaption', $params['displaycaption']); } if (isset($params['monthformat'])) { $Calendar->set('monthformat', $params['monthformat']); } if (isset($params['linktomontharchive'])) { $Calendar->set('linktomontharchive', $params['linktomontharchive']); } if (isset($params['tablestart'])) { $Calendar->set('tablestart', $params['tablestart']); } if (isset($params['tableend'])) { $Calendar->set('tableend', $params['tableend']); } if (isset($params['monthstart'])) { $Calendar->set('monthstart', $params['monthstart']); } if (isset($params['monthend'])) { $Calendar->set('monthend', $params['monthend']); } if (isset($params['rowstart'])) { $Calendar->set('rowstart', $params['rowstart']); } if (isset($params['rowend'])) { $Calendar->set('rowend', $params['rowend']); } if (isset($params['headerdisplay'])) { $Calendar->set('headerdisplay', $params['headerdisplay']); } if (isset($params['headerrowstart'])) { $Calendar->set('headerrowstart', $params['headerrowstart']); } if (isset($params['headerrowend'])) { $Calendar->set('headerrowend', $params['headerrowend']); } if (isset($params['headercellstart'])) { $Calendar->set('headercellstart', $params['headercellstart']); } if (isset($params['headercellend'])) { $Calendar->set('headercellend', $params['headercellend']); } if (isset($params['cellstart'])) { $Calendar->set('cellstart', $params['cellstart']); } if (isset($params['cellend'])) { $Calendar->set('cellend', $params['cellend']); } if (isset($params['emptycellstart'])) { $Calendar->set('emptycellstart', $params['emptycellstart']); } if (isset($params['emptycellend'])) { $Calendar->set('emptycellend', $params['emptycellend']); } if (isset($params['emptycellcontent'])) { $Calendar->set('emptycellcontent', $params['emptycellcontent']); } if (isset($params['linkpostcellstart'])) { $Calendar->set('linkpostcellstart', $params['linkpostcellstart']); } if (isset($params['linkposttodaycellstart'])) { $Calendar->set('linkposttodaycellstart', $params['linkposttodaycellstart']); } if (isset($params['todaycellstart'])) { $Calendar->set('todaycellstart', $params['todaycellstart']); } if (isset($params['todaycellstartpost'])) { $Calendar->set('todaycellstartpost', $params['todaycellstartpost']); } if (isset($params['navigation'])) { $Calendar->set('navigation', $params['navigation']); } if (isset($params['browseyears'])) { $Calendar->set('browseyears', $params['browseyears']); } if (isset($params['postcount_month_atitle'])) { $Calendar->set('postcount_month_atitle', $params['postcount_month_atitle']); } if (isset($params['postcount_month_atitle_one'])) { $Calendar->set('postcount_month_atitle_one', $params['postcount_month_atitle_one']); } if (isset($params['postcount_year_atitle'])) { $Calendar->set('postcount_year_atitle', $params['postcount_year_atitle']); } if (isset($params['postcount_year_atitle_one'])) { $Calendar->set('postcount_year_atitle_one', $params['postcount_year_atitle_one']); } // Link type: if (isset($params['link_type'])) { $Calendar->set('link_type', $params['link_type']); } if (isset($params['context_isolation'])) { $Calendar->set('context_isolation', $params['context_isolation']); } echo $params['block_start']; if (!empty($params['title'])) { // We want to display a title for the widget block: echo $params['block_title_start']; echo $params['title']; echo $params['block_title_end']; } // CONSTRUCT THE WHERE CLAUSE: // - - Select a specific Item: // $this->ItemQuery->where_ID( $p, $title ); if ($Calendar->link_type == 'context') { // We want to preserve the current context: // * - - Restrict to selected blog/categories: $Calendar->ItemQuery->where_chapter2($Blog, $cat_array, $cat_modifier); // * Restrict to the statuses we want to show: $Calendar->ItemQuery->where_visibility($show_statuses); // Restrict to selected authors: $Calendar->ItemQuery->where_author($author); // Restrict to selected assignees: $Calendar->ItemQuery->where_assignees($assgn); // Restrict to selected satuses: $Calendar->ItemQuery->where_statuses($status); // - - - + * * if a month is specified in the querystring, load that month: $Calendar->ItemQuery->where_datestart('', '', $dstart, '', $Blog->get_timestamp_min(), $Blog->get_timestamp_max()); // Keyword search stuff: $Calendar->ItemQuery->where_keywords($s, $sentence, $exact); // Exclude pages and intros: $Calendar->ItemQuery->where_types($types); } else { // We want to preserve only the minimal context: // * - - Restrict to selected blog/categories: $Calendar->ItemQuery->where_chapter2($Blog, array(), ''); // * Restrict to the statuses we want to show: $Calendar->ItemQuery->where_visibility($show_statuses); // - - - + * * if a month is specified in the querystring, load that month: $Calendar->ItemQuery->where_datestart('', '', '', '', $Blog->get_timestamp_min(), $Blog->get_timestamp_max()); // Exclude pages and intros and sidebar stuff: $Calendar->ItemQuery->where_types('-' . implode(',', $posttypes_specialtypes)); } // DISPLAY: $Calendar->display(); echo $params['block_end']; return true; }
<html> <head> <title>日历demo</title> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" /> <style type="text/css"> table.calendar { border: 1px solid #050; } .calendar th, .calendar td { width:30px; text-align:center; } .calendar th { background-color:#050; color:#fff; } .today{ color:#fff; background-color:#050; } </style> </head> <body> <div style="align:center"> <?php $cal = new Calendar($params); $cal->display(); ?> </div> </body> </html>
/** * Event handler: SkinTag (widget) * * @param array Associative array of parameters. Valid keys are: * - 'block_start' : (Default: '<div class="bSideItem">') * - 'block_end' : (Default: '</div>') * - 'title' : (Default: T_('Calendar')) * - 'displaycaption' * - 'monthformat' * - 'linktomontharchive' * - 'tablestart' * - 'tableend' * - 'monthstart' * - 'monthend' * - 'rowstart' * - 'rowend' * - 'headerdisplay' * - 'headerrowstart' * - 'headerrowend' * - 'headercellstart' * - 'headercellend' * - 'cellstart' * - 'cellend' * - 'linkpostcellstart' * - 'linkposttodaycellstart' * - 'todaycellstart' * - 'todaycellstartpost' * - 'navigation' : Where do we want to have the navigation arrows? (Default: 'tfoot') * - 'browseyears' : boolean Do we want arrows to move one year at a time? * - 'min_timestamp' : Minimum unix timestamp the user can browse too or 'query' (Default: 2000-01-01) * - 'max_timestamp' : Maximum unix timestamp the user can browse too or 'query' (Default: now + 1 year ) * - 'postcount_month_atitle' * - 'postcount_month_atitle_one' * - 'postcount_year_atitle' * - 'postcount_year_atitle_one' * - 'link_type' : 'canonic'|'context' (default: canonic) * @return boolean did we display? */ function SkinTag($params) { // Prefix of the ItemList object $itemlist_prefix = isset($params['itemlist_prefix']) ? $params['itemlist_prefix'] : ''; global $month; global $Blog, $cat_array, $cat_modifier; global $show_statuses; global $author, $assgn, $status, $types; global ${$itemlist_prefix . 'm'}, $w, $dstart; global $s, $sentence, $exact; global $posttypes_specialtypes; /** * Default params: */ $params = array_merge(array('block_start' => '<div class="bSideItem">', 'block_end' => "</div>\n", 'block_title_start' => '<h3>', 'block_title_end' => '</h3>', 'block_body_start' => '', 'block_body_end' => ''), $params); $Calendar = new Calendar(${$itemlist_prefix . 'm'}, $params); // TODO: automate with a table inside of Calendatr object. Table should also contain descriptions and default values to display in help screen. // Note: minbrowse and maxbrowe already work this way. if (isset($params['displaycaption'])) { $Calendar->set('displaycaption', $params['displaycaption']); } if (isset($params['monthformat'])) { $Calendar->set('monthformat', $params['monthformat']); } if (isset($params['linktomontharchive'])) { $Calendar->set('linktomontharchive', $params['linktomontharchive']); } if (isset($params['tablestart'])) { $Calendar->set('tablestart', $params['tablestart']); } if (isset($params['tableend'])) { $Calendar->set('tableend', $params['tableend']); } if (isset($params['monthstart'])) { $Calendar->set('monthstart', $params['monthstart']); } if (isset($params['monthend'])) { $Calendar->set('monthend', $params['monthend']); } if (isset($params['rowstart'])) { $Calendar->set('rowstart', $params['rowstart']); } if (isset($params['rowend'])) { $Calendar->set('rowend', $params['rowend']); } if (isset($params['headerdisplay'])) { $Calendar->set('headerdisplay', $params['headerdisplay']); } if (isset($params['headerrowstart'])) { $Calendar->set('headerrowstart', $params['headerrowstart']); } if (isset($params['headerrowend'])) { $Calendar->set('headerrowend', $params['headerrowend']); } if (isset($params['headercellstart'])) { $Calendar->set('headercellstart', $params['headercellstart']); } if (isset($params['headercellend'])) { $Calendar->set('headercellend', $params['headercellend']); } if (isset($params['cellstart'])) { $Calendar->set('cellstart', $params['cellstart']); } if (isset($params['cellend'])) { $Calendar->set('cellend', $params['cellend']); } if (isset($params['emptycellstart'])) { $Calendar->set('emptycellstart', $params['emptycellstart']); } if (isset($params['emptycellend'])) { $Calendar->set('emptycellend', $params['emptycellend']); } if (isset($params['emptycellcontent'])) { $Calendar->set('emptycellcontent', $params['emptycellcontent']); } if (isset($params['linkpostcellstart'])) { $Calendar->set('linkpostcellstart', $params['linkpostcellstart']); } if (isset($params['linkposttodaycellstart'])) { $Calendar->set('linkposttodaycellstart', $params['linkposttodaycellstart']); } if (isset($params['todaycellstart'])) { $Calendar->set('todaycellstart', $params['todaycellstart']); } if (isset($params['todaycellstartpost'])) { $Calendar->set('todaycellstartpost', $params['todaycellstartpost']); } if (isset($params['navigation'])) { $Calendar->set('navigation', $params['navigation']); } if (isset($params['browseyears'])) { $Calendar->set('browseyears', $params['browseyears']); } if (isset($params['postcount_month_atitle'])) { $Calendar->set('postcount_month_atitle', $params['postcount_month_atitle']); } if (isset($params['postcount_month_atitle_one'])) { $Calendar->set('postcount_month_atitle_one', $params['postcount_month_atitle_one']); } if (isset($params['postcount_year_atitle'])) { $Calendar->set('postcount_year_atitle', $params['postcount_year_atitle']); } if (isset($params['postcount_year_atitle_one'])) { $Calendar->set('postcount_year_atitle_one', $params['postcount_year_atitle_one']); } // Link type: if (isset($params['link_type'])) { $Calendar->set('link_type', $params['link_type']); } if (isset($params['context_isolation'])) { $Calendar->set('context_isolation', $params['context_isolation']); } echo $params['block_start']; if (!empty($params['title'])) { // We want to display a title for the widget block: echo $params['block_title_start']; if ($params['title_link']) { // Set block title as link to current collection: echo '<a href="' . $Blog->gen_blogurl() . '" rel="nofollow">' . $params['title'] . '</a>'; } else { // Display a block title as simple text: echo $params['title']; } echo $params['block_title_end']; } echo $params['block_body_start']; // CONSTRUCT THE WHERE CLAUSE: // - - Select a specific Item: // $this->ItemQuery->where_ID( $p, $title ); // Set filter by collection: $blog_ID = empty($params['blog_ID']) ? NULL : $params['blog_ID']; if (empty($params['cat_IDs'])) { // Use default categories filter: $filter_cat_array = $Calendar->link_type == 'context' ? $cat_array : array(); } else { // Get categories filter from widget settings: $filter_cat_array = sanitize_id_list($params['cat_IDs'], true); } if ($Calendar->link_type == 'context') { // We want to preserve the current context: // * - - Restrict to selected blog/categories: $Calendar->ItemQuery->where_chapter2($Blog, $filter_cat_array, $cat_modifier, 'wide', $blog_ID); // Restrict to selected authors: $Calendar->ItemQuery->where_author($author); // Restrict to selected assignees: $Calendar->ItemQuery->where_assignees($assgn); // Restrict to selected satuses: $Calendar->ItemQuery->where_statuses($status); // - - - + * * if a month is specified in the querystring, load that month: $Calendar->ItemQuery->where_datestart('', '', $dstart, '', $Blog->get_timestamp_min(), $Blog->get_timestamp_max()); // Keyword search stuff: $Calendar->ItemQuery->where_keywords($s, $sentence, $exact); } else { // We want to preserve only the minimal context: // * - - Restrict to selected blog/categories: $Calendar->ItemQuery->where_chapter2($Blog, $filter_cat_array, '', 'wide', $blog_ID); // - - - + * * if a month is specified in the querystring, load that month: $Calendar->ItemQuery->where_datestart('', '', '', '', $Blog->get_timestamp_min(), $Blog->get_timestamp_max()); } if (isset($params['item_visibility']) && $params['item_visibility'] == 'public') { // Get only the public items: $visibility_array = array('published'); } else { // Get the current selected status items: $visibility_array = $show_statuses; } // * Restrict to the statuses we want to show: $Calendar->ItemQuery->where_visibility($visibility_array); $item_types = $types; if (isset($params['item_type'])) { if ($params['item_type'] == '#') { // Exclude pages and intros and sidebar stuff by default: $item_types = '-' . implode(',', $posttypes_specialtypes); } elseif ($params['item_type'] != 'all') { // Filter by one selected item type: $item_types = $params['item_type']; } } // Filter by item types: $Calendar->ItemQuery->where_types($item_types); // DISPLAY: $Calendar->display(); echo $params['block_body_end']; echo $params['block_end']; return true; }
<?php //This file is part of NOALYSS and is under GPL //see licence.txt /** * @file * @brief show the calendar */ if (!defined('ALLOWED')) { die('Appel direct ne sont pas permis'); } require_once NOALYSS_INCLUDE . '/class_calendar.php'; $cal = new Calendar(); $cal->default_periode = isset($_GET['in']) ? $_GET['in'] : $g_user->get_periode(); ?> <div id="calendar_zoom_div"> <?php echo $cal->display('long', 1); ?> </div>
/** * Access calendar package to display event calendar * * @package events * @version $Header$ * @author nickpalmer */ /** * required setup */ require_once '../kernel/setup_inc.php'; require_once EVENTS_PKG_PATH . 'BitEvents.php'; if ($gBitSystem->isPackageActive('calendar')) { include_once CALENDAR_PKG_PATH . 'Calendar.php'; $gBitSystem->verifyPermission('p_calendar_view'); // now, lets get the ball rolling! $gCalendar = new Calendar(); $gCalendar->processRequestHash($_REQUEST, $_SESSION['calendar']); // Setup which content types we want to view. $listHash['content_type_guid'] = array('bitevents'); $events = new BitEvents(); if (empty($_REQUEST['event_after'])) { $_REQUEST['event_after'] = $gBitSystem->getUTCTime(); } $listevents = $events->getList($_REQUEST); // Build the calendar $gCalendar->buildCalendar($listHash, $_SESSION['calendar']); // And display it with a nice title. $gCalendar->display(tra('Events Calendar'), FALSE, EVENTS_PKG_URL . 'calendar.php'); }
<data> <code>bkname</code> <value>{$html}</value> </data> EOF; break; // display new calendar // display new calendar case 'cal': require_once NOALYSS_INCLUDE . '/class_calendar.php'; /* others report */ $cal = new Calendar(); $cal->set_periode($per); $notitle = HtmlInput::default_value_get("notitle", 0); $html = ""; $html = $cal->display($_GET['t'], $notitle); $html = escape_xml($html); header('Content-type: text/xml; charset=UTF-8'); echo <<<EOF <?xml version="1.0" encoding="UTF-8"?> <data> <code>{$html}</code> </data> EOF; break; /* rem a cat of document */ /* rem a cat of document */ case 'rem_cat_doc': require_once NOALYSS_INCLUDE . '/class_document_type.php'; // if user can not return error message $message = "";
<?php // $Header$ // Copyright( c ) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See below for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details. require_once '../kernel/setup_inc.php'; include_once CALENDAR_PKG_PATH . 'Calendar.php'; $gBitSystem->isPackageActive('calendar', TRUE); $gBitSystem->verifyPermission('p_calendar_view'); // now, lets get the ball rolling! $gCalendar = new Calendar(); // Handle the request hash storing into the session. $gCalendar->processRequestHash($_REQUEST, $_SESSION['calendar']); // Setup which content types we want to view. if ($gBitUser->hasPermission("p_calendar_view_changes") && $_SESSION['calendar']['content_type_guid']) { $listHash = $_SESSION['calendar']; } else { foreach ($gLibertySystem->mContentTypes as $key => $val) { if ($gBitSystem->isFeatureActive('calendar_default_' . $key)) { $listHash['content_type_guid'][] = $key; } } } // Build the calendar $gCalendar->buildCalendar($listHash, $_SESSION['calendar']); // And display it with a nice title. $gCalendar->display(tra('Calendar'));
if ($m > 12) { echo "Fehler!!! Kein gültiger Monat"; } elseif ($y >= date("Y") + 9) { echo "Zu hohes Datum"; } elseif ($y <= date("Y") - 9) { echo "Zu geringes Datum"; } elseif ($d > 31 || $d < 1) { echo "kein gültiger Tag"; } else { if ($action == "addNew") { $cal->addMeeting($d, $m, $y); echo "{$d} - {$m} - {$y}"; } else { if ($action == "viewDay") { $cal->viewDay($d, $m, $y, $id); } else { if ($action == "getAll") { $cal->getAllMeetings($id); } else { if ($action == "insertDB") { echo $date; $date = explode(".", $date); $cal->insertDB($date[0], $date[1], $date[2], $begin, $duration, $place, $description, $persons, $id); } else { $cal->display($m, $y, $id); } } } } } require "inc/footer.inc.php";