예제 #1
0
 function launch()
 {
     global $configArray;
     global $interface;
     global $user;
     $source = $_REQUEST['source'];
     $sourceId = $_REQUEST['id'];
     $existingWidget = isset($_REQUEST['widgetId']) ? $_REQUEST['widgetId'] : -1;
     $widgetName = isset($_REQUEST['widgetName']) ? $_REQUEST['widgetName'] : '';
     if ($existingWidget == -1) {
         $widget = new ListWidget();
         $widget->name = $widgetName;
         if ($user->hasRole('libraryAdmin') || $user->hasRole('contentEditor')) {
             //Get all widgets for the library
             $userLibrary = Library::getPatronHomeLibrary();
             $widget->libraryId = $userLibrary->libraryId;
         } else {
             $widget->libraryId = -1;
         }
         $widget->customCss = '';
         $widget->autoRotate = 0;
         $widget->description = '';
         $widget->showTitleDescriptions = 1;
         $widget->onSelectCallback = '';
         $widget->fullListLink = '';
         $widget->listDisplayType = 'tabs';
         $widget->showMultipleTitles = 1;
         $widget->insert();
     } else {
         $widget = new ListWidget();
         $widget->id = $existingWidget;
         $widget->find(true);
     }
     //Make sure to save the search
     if ($source == 'search') {
         $searchObject = new SearchEntry();
         $searchObject->id = $sourceId;
         $searchObject->find(true);
         $searchObject->saved = 1;
         $searchObject->update();
     }
     //Add the list to the widget
     $widgetList = new ListWidgetList();
     $widgetList->listWidgetId = $widget->id;
     $widgetList->displayFor = 'all';
     $widgetList->source = "{$source}:{$sourceId}";
     $widgetList->name = $widgetName;
     $widgetList->weight = 0;
     $widgetList->insert();
     //Redirect to the widget
     header("Location: {$path}/Admin/ListWidgets?objectAction=view&id={$widget->id}");
 }
예제 #2
0
 function launch()
 {
     global $interface;
     global $configArray;
     global $library;
     global $locationSingleton;
     global $timer;
     global $user;
     // Include Search Engine Class
     require_once ROOT_DIR . '/sys/' . $configArray['Index']['engine'] . '.php';
     $timer->logTime('Include search engine');
     $interface->assign('showBreadcrumbs', 0);
     if ($user) {
         $catalog = new CatalogConnection($configArray['Catalog']['driver']);
         $patron = $catalog->patronLogin($user->cat_username, $user->cat_password);
         $profile = $catalog->getMyProfile($patron);
         if (!PEAR_Singleton::isError($profile)) {
             $interface->assign('profile', $profile);
         }
     }
     //Get the lists to show on the home page
     require_once ROOT_DIR . '/sys/ListWidget.php';
     $widgetId = 1;
     $activeLocation = $locationSingleton->getActiveLocation();
     if ($activeLocation != null && $activeLocation->homePageWidgetId > 0) {
         $widgetId = $activeLocation->homePageWidgetId;
         $widget = new ListWidget();
         $widget->id = $widgetId;
         if ($widget->find(true)) {
             $interface->assign('widget', $widget);
         }
     } else {
         if (isset($library) && $library->homePageWidgetId > 0) {
             $widgetId = $library->homePageWidgetId;
             $widget = new ListWidget();
             $widget->id = $widgetId;
             if ($widget->find(true)) {
                 $interface->assign('widget', $widget);
             }
         }
     }
     // Cache homepage
     $interface->caching = 0;
     $cacheId = 'homepage|' . $interface->lang;
     //Disable Home page caching for now.
     if (!$interface->is_cached('layout.tpl', $cacheId)) {
         $interface->setPageTitle('Catalog Home');
         $interface->setTemplate('home.tpl');
     }
     $interface->display('layout.tpl', $cacheId);
 }
예제 #3
0
 function fullListLink()
 {
     require_once ROOT_DIR . '/services/API/ListAPI.php';
     $listAPI = new ListAPI();
     $cacheInfo = $listAPI->getCacheInfoForListId($this->source);
     $link = $cacheInfo['fullListLink'];
     //Get the widget for the list
     $widget = new ListWidget();
     $widget->id = $this->listWidgetId;
     if ($widget->find(true)) {
         if ($widget->viewMoreLinkMode == 'covers') {
             $cacheInfo['fullListLink'] .= '&view=covers';
         }
     }
     return $cacheInfo['fullListLink'];
 }
예제 #4
0
 function validateName()
 {
     //Setup validation return array
     $validationResults = array('validatedOk' => true, 'errors' => array());
     //Check to see if the name is unique
     $widget = new ListWidget();
     $widget->name = $this->name;
     if ($this->id) {
         $widget->whereAdd("id != " . $this->id);
     }
     $widget->libraryId = $this->libraryId;
     $widget->find();
     if ($widget->N > 0) {
         //The title is not unique
         $validationResults['errors'][] = "This widget has already been created.  Please select another name.";
     }
     //Make sure there aren't errors
     if (count($validationResults['errors']) > 0) {
         $validationResults['validatedOk'] = false;
     }
     return $validationResults;
 }
예제 #5
0
파일: lockrules.php 프로젝트: ratbird/hope
 /**
  * edit one lock rule
  */
 function edit_action($lock_rule_id)
 {
     $this->lock_rule = LockRule::find($lock_rule_id);
     $this->lock_config = LockRules::getLockRuleConfig($this->lock_rule_type);
     if (Request::submitted('ok')) {
         $ok = $this->handle_form_data();
         if ($ok === false) {
             PageLayout::postMessage(MessageBox::error(_('Die Änderungen der Sperrebene konnten nicht gespeichert werden.'), $this->msg['error']));
         } else {
             if ($ok) {
                 PageLayout::postMessage(MessageBox::success(_('Die Änderungen wurden gespeichert.')));
             }
         }
     }
     $info = new ListWidget();
     $info->setTitle(_('Informationen'));
     $info->addElement(new WidgetElement(sprintf(_('Diese Sperrebene wird von %s Objekten benutzt.'), $this->lock_rule->getUsage())));
     $this->sidebar->addWidget($info);
     $actions = new ActionsWidget();
     $actions->addLink(_('Diese Ebene löschen'), $this->url_for('admin/lockrules/delete/' . $this->lock_rule->getid()), Icon::create('trash', 'clickable'));
     $actions->addLink(_('Bearbeiten abbrechen'), $this->url_for('admin/lockrules'), Icon::create('decline', 'clickable'));
     $this->sidebar->addWidget($actions);
 }
예제 #6
0
 static function getObjectStructure()
 {
     // get the structure for the library system's holidays
     $holidaysStructure = Holiday::getObjectStructure();
     // we don't want to make the libraryId property editable
     // because it is associated with this library system only
     unset($holidaysStructure['libraryId']);
     $nearbyBookStoreStructure = NearbyBookStore::getObjectStructure();
     unset($nearbyBookStoreStructure['weight']);
     unset($nearbyBookStoreStructure['libraryId']);
     $facetSettingStructure = LibraryFacetSetting::getObjectStructure();
     unset($facetSettingStructure['weight']);
     unset($facetSettingStructure['libraryId']);
     unset($facetSettingStructure['numEntriesToShowByDefault']);
     unset($facetSettingStructure['showAsDropDown']);
     //unset($facetSettingStructure['sortMode']);
     $searchSourceStructure = LibrarySearchSource::getObjectStructure();
     unset($searchSourceStructure['weight']);
     unset($searchSourceStructure['libraryId']);
     $libraryMoreDetailsStructure = LibraryMoreDetails::getObjectStructure();
     unset($libraryMoreDetailsStructure['weight']);
     unset($libraryMoreDetailsStructure['libraryId']);
     $libraryLinksStructure = LibraryLinks::getObjectStructure();
     unset($libraryLinksStructure['weight']);
     unset($libraryLinksStructure['libraryId']);
     $libraryTopLinksStructure = LibraryTopLinks::getObjectStructure();
     unset($libraryTopLinksStructure['weight']);
     unset($libraryTopLinksStructure['libraryId']);
     $libraryBrowseCategoryStructure = LibraryBrowseCategory::getObjectStructure();
     unset($libraryBrowseCategoryStructure['weight']);
     unset($libraryBrowseCategoryStructure['libraryId']);
     global $user;
     require_once ROOT_DIR . '/sys/ListWidget.php';
     $widget = new ListWidget();
     if (($user->hasRole('libraryAdmin') || $user->hasRole('contentEditor')) && !$user->hasRole('opacAdmin')) {
         $patronLibrary = Library::getPatronHomeLibrary();
         if ($patronLibrary) {
             $widget->libraryId = $patronLibrary->libraryId;
         }
     }
     $availableWidgets = array();
     $widget->orderBy('name');
     $widget->find();
     $availableWidgets[0] = 'No Widget';
     while ($widget->fetch()) {
         $availableWidgets[$widget->id] = $widget->name;
     }
     $structure = array('libraryId' => array('property' => 'libraryId', 'type' => 'label', 'label' => 'Library Id', 'description' => 'The unique id of the library within the database'), 'subdomain' => array('property' => 'subdomain', 'type' => 'text', 'label' => 'Subdomain', 'description' => 'A unique id to identify the library within the system'), 'displayName' => array('property' => 'displayName', 'type' => 'text', 'label' => 'Display Name', 'description' => 'A name to identify the library within the system', 'size' => '40'), 'showDisplayNameInHeader' => array('property' => 'showDisplayNameInHeader', 'type' => 'checkbox', 'label' => 'Show Display Name in Header', 'description' => 'Whether or not the display name should be shown in the header next to the logo', 'hideInLists' => true, 'default' => false), 'abbreviatedDisplayName' => array('property' => 'abbreviatedDisplayName', 'type' => 'text', 'label' => 'Abbreviated Display Name', 'description' => 'A short name to identify the library when space is low', 'size' => '40'), 'systemMessage' => array('property' => 'systemMessage', 'type' => 'html', 'label' => 'System Message', 'description' => 'A message to be displayed at the top of the screen', 'size' => '80', 'maxLength' => '512', 'allowableTags' => '<a><b><em><div><script><span><p><strong><sub><sup>', 'hideInLists' => true), array('property' => 'displaySection', 'type' => 'section', 'label' => 'Basic Display', 'hideInLists' => true, 'properties' => array('themeName' => array('property' => 'themeName', 'type' => 'text', 'label' => 'Theme Name', 'description' => 'The name of the theme which should be used for the library', 'hideInLists' => true, 'default' => 'default'), 'homeLink' => array('property' => 'homeLink', 'type' => 'text', 'label' => 'Home Link', 'description' => 'The location to send the user when they click on the home button or logo.  Use default or blank to go back to the Pika home location.', 'size' => '40', 'hideInLists' => true), 'additionalCss' => array('property' => 'additionalCss', 'type' => 'textarea', 'label' => 'Additional CSS', 'description' => 'Extra CSS to apply to the site.  Will apply to all pages.', 'hideInLists' => true), 'useHomeLinkInBreadcrumbs' => array('property' => 'useHomeLinkInBreadcrumbs', 'type' => 'checkbox', 'label' => 'Use Home Link in Breadcrumbs', 'description' => 'Whether or not the home link should be used in the breadcumbs.', 'hideInLists' => true), 'useHomeLinkForLogo' => array('property' => 'useHomeLinkForLogo', 'type' => 'checkbox', 'label' => 'Use Home Link for Logo', 'description' => 'Whether or not the home link should be used as the link for the main logo.', 'hideInLists' => true), 'homeLinkText' => array('property' => 'homeLinkText', 'type' => 'text', 'label' => 'Home Link Text', 'description' => 'The text to show for the Home breadcrumb link', 'size' => '40', 'hideInLists' => true, 'default' => 'Home'), 'showLibraryHoursAndLocationsLink' => array('property' => 'showLibraryHoursAndLocationsLink', 'type' => 'checkbox', 'label' => 'Show Library Hours and Locations Link', 'description' => 'Whether or not the library hours and locations link is shown on the home page.', 'hideInLists' => true, 'default' => true), 'eContentSupportAddress' => array('property' => 'eContentSupportAddress', 'type' => 'multiemail', 'label' => 'E-Content Support Address', 'description' => 'An e-mail address to receive support requests for patrons with eContent problems.', 'size' => '80', 'hideInLists' => true, 'default' => '*****@*****.**'), 'enableGenealogy' => array('property' => 'enableGenealogy', 'type' => 'checkbox', 'label' => 'Enable Genealogy Functionality', 'description' => 'Whether or not patrons can search genealogy.', 'hideInLists' => true, 'default' => 1), 'enableCourseReserves' => array('property' => 'enableCourseReserves', 'type' => 'checkbox', 'label' => 'Enable Repeat Search in Course Reserves', 'description' => 'Whether or not patrons can repeat searches within course reserves.', 'hideInLists' => true), 'defaultBrowseMode' => array('property' => 'defaultBrowseMode', 'type' => 'enum', 'label' => 'Default Viewing Mode for Browse Categories', 'description' => 'Sets how browse categories will be displayed when users haven\'t chosen themselves.', 'hideInLists' => true, 'values' => array('covers' => 'Show Covers Only', 'grid' => 'Show as Grid'), 'default' => 'covers'))), array('property' => 'contact', 'type' => 'section', 'label' => 'Contact Links', 'hideInLists' => true, 'properties' => array('facebookLink' => array('property' => 'facebookLink', 'type' => 'text', 'label' => 'Facebook Link Url', 'description' => 'The url to Facebook (leave blank if the library does not have a Facebook account', 'size' => '40', 'maxLength' => 255, 'hideInLists' => true), 'twitterLink' => array('property' => 'twitterLink', 'type' => 'text', 'label' => 'Twitter Link Url', 'description' => 'The url to Twitter (leave blank if the library does not have a Twitter account', 'size' => '40', 'maxLength' => 255, 'hideInLists' => true), 'youtubeLink' => array('property' => 'youtubeLink', 'type' => 'text', 'label' => 'Youtube Link Url', 'description' => 'The url to Youtube (leave blank if the library does not have a Youtube account', 'size' => '40', 'maxLength' => 255, 'hideInLists' => true), 'instagramLink' => array('property' => 'instagramLink', 'type' => 'text', 'label' => 'Instagram Link Url', 'description' => 'The url to Instagram (leave blank if the library does not have a Instagram account', 'size' => '40', 'maxLength' => 255, 'hideInLists' => true), 'goodreadsLink' => array('property' => 'goodreadsLink', 'type' => 'text', 'label' => 'GoodReads Link Url', 'description' => 'The url to GoodReads (leave blank if the library does not have a GoodReads account', 'size' => '40', 'maxLength' => 255, 'hideInLists' => true), 'generalContactLink' => array('property' => 'generalContactLink', 'type' => 'text', 'label' => 'General Contact Link Url', 'description' => 'The url to a General Contact Page, i.e webform or mailto link', 'size' => '40', 'maxLength' => 255, 'hideInLists' => true))), array('property' => 'ilsSection', 'type' => 'section', 'label' => 'ILS/Account Integration', 'hideInLists' => true, 'properties' => array('ilsCode' => array('property' => 'ilsCode', 'type' => 'text', 'label' => 'ILS Code', 'description' => 'The location code that all items for this location start with.', 'size' => '4', 'hideInLists' => false), 'scope' => array('property' => 'scope', 'type' => 'text', 'label' => 'Scope', 'description' => 'The scope for the system in Millennium to refine holdings for the user.', 'size' => '4', 'hideInLists' => true), 'useScope' => array('property' => 'useScope', 'type' => 'checkbox', 'label' => 'Use Scope', 'description' => 'Whether or not the scope should be used when displaying holdings.', 'hideInLists' => true), 'orderAccountingUnit' => array('property' => 'orderAccountingUnit', 'type' => 'integer', 'label' => 'Order Accounting Unit', 'description' => 'The accounting unit this library belongs to for orders', 'size' => '4', 'hideInLists' => false), 'makeOrderRecordsAvailableToOtherLibraries' => array('property' => 'makeOrderRecordsAvailableToOtherLibraries', 'type' => 'checkbox', 'label' => 'Make Order Records Available To Other Libraries', 'description' => 'Whether or not order records should be shown to other libraries', 'hideInLists' => true), 'minBarcodeLength' => array('property' => 'minBarcodeLength', 'type' => 'integer', 'label' => 'Min Barcode Length', 'description' => 'A minimum length the patron barcode is expected to be. Leave as 0 to extra processing of barcodes.', 'hideInLists' => true, 'default' => 0), 'maxBarcodeLength' => array('property' => 'maxBarcodeLength', 'type' => 'integer', 'label' => 'Max Barcode Length', 'description' => 'The maximum length the patron barcode is expected to be. Leave as 0 to extra processing of barcodes.', 'hideInLists' => true, 'default' => 0), 'barcodePrefix' => array('property' => 'barcodePrefix', 'type' => 'text', 'label' => 'Barcode Prefix', 'description' => 'A barcode prefix to apply to the barcode if it does not start with the barcode prefix or if it is not within the expected min/max range.  Multiple prefixes can be specified by separating them with commas. Leave blank to avoid additional processing of barcodes.', 'hideInLists' => true, 'default' => ''), 'pTypes' => array('property' => 'pTypes', 'type' => 'text', 'label' => 'P-Types', 'description' => 'A list of pTypes that are valid for the library.  Separate multiple pTypes with commas.'), 'defaultPType' => array('property' => 'defaultPType', 'type' => 'text', 'label' => 'Default P-Type', 'description' => 'The P-Type to use when accessing a subdomain if the patron is not logged in.'), 'showExpirationWarnings' => array('property' => 'showExpirationWarnings', 'type' => 'checkbox', 'label' => 'Show Expiration Warnings', 'description' => 'Whether or not the user should be shown expiration warnings if their card is nearly expired.', 'hideInLists' => true, 'default' => 1), 'userProfileSection' => array('property' => 'userProfileSection', 'type' => 'section', 'label' => 'User Profile', 'hideInLists' => true, 'properties' => array('allowProfileUpdates' => array('property' => 'allowProfileUpdates', 'type' => 'checkbox', 'label' => 'Allow Profile Updates', 'description' => 'Whether or not the user can update their own profile.', 'hideInLists' => true, 'default' => 1), 'allowPatronAddressUpdates' => array('property' => 'allowPatronAddressUpdates', 'type' => 'checkbox', 'label' => 'Allow Patrons to Update Their Address', 'description' => 'Whether or not patrons should be able to update their own address in their profile.', 'hideInLists' => true, 'default' => 1), 'showAlternateLibraryOptionsInProfile' => array('property' => 'showAlternateLibraryOptionsInProfile', 'type' => 'checkbox', 'label' => 'Allow Patrons to Update their Alternate Libraries', 'description' => 'Allow Patrons to See and Change Alternate Library Settings in the Catalog Options Tab in their profile.', 'hideInLists' => true, 'default' => 1), 'showWorkPhoneInProfile' => array('property' => 'showWorkPhoneInProfile', 'type' => 'checkbox', 'label' => 'Show Work Phone in Profile', 'description' => 'Whether or not patrons should be able to change a secondary/work phone number in their profile.', 'hideInLists' => true, 'default' => 0), 'treatPrintNoticesAsPhoneNotices' => array('property' => 'treatPrintNoticesAsPhoneNotices', 'type' => 'checkbox', 'label' => 'Treat Print Notices As Phone Notices', 'description' => 'When showing detailed information about hold notices, treat print notices as if they are phone calls', 'hideInLists' => true, 'default' => 0), 'showNoticeTypeInProfile' => array('property' => 'showNoticeTypeInProfile', 'type' => 'checkbox', 'label' => 'Show Notice Type in Profile', 'description' => 'Whether or not patrons should be able to change how they receive notices in their profile.', 'hideInLists' => true, 'default' => 0), 'showPickupLocationInProfile' => array('property' => 'showPickupLocationInProfile', 'type' => 'checkbox', 'label' => 'Allow Patrons to Update Their Pickup Location', 'description' => 'Whether or not patrons should be able to update their preferred pickup location in their profile.', 'hideInLists' => true, 'default' => 0), 'addSMSIndicatorToPhone' => array('property' => 'addSMSIndicatorToPhone', 'type' => 'checkbox', 'label' => 'Add SMS Indicator to Primary Phone', 'description' => 'Whether or not add TEXT ONLY to the user\'s primary phone number when they opt in to SMS notices.', 'hideInLists' => true, 'default' => 0))), 'holdsSection' => array('property' => 'holdsSection', 'type' => 'section', 'label' => 'Holds', 'hideInLists' => true, 'properties' => array('showHoldButton' => array('property' => 'showHoldButton', 'type' => 'checkbox', 'label' => 'Show Hold Button', 'description' => 'Whether or not the hold button is displayed so patrons can place holds on items', 'hideInLists' => true, 'default' => 1), 'showHoldButtonInSearchResults' => array('property' => 'showHoldButtonInSearchResults', 'type' => 'checkbox', 'label' => 'Show Hold Button within the search results', 'description' => 'Whether or not the hold button is displayed within the search results so patrons can place holds on items', 'hideInLists' => true, 'default' => 1), 'showHoldCancelDate' => array('property' => 'showHoldCancelDate', 'type' => 'checkbox', 'label' => 'Show Cancellation Date', 'description' => 'Whether or not the patron should be able to set a cancellation date (not needed after date) when placing holds.', 'hideInLists' => true, 'default' => 1), 'allowFreezeHolds' => array('property' => 'allowFreezeHolds', 'type' => 'checkbox', 'label' => 'Allow Freezing Holds', 'description' => 'Whether or not the user can freeze their holds.', 'hideInLists' => true, 'default' => 1), 'defaultNotNeededAfterDays' => array('property' => 'defaultNotNeededAfterDays', 'type' => 'integer', 'label' => 'Default Not Needed After Days', 'description' => 'Number of days to use for not needed after date by default. Use -1 for no default.', 'hideInLists' => true), 'showDetailedHoldNoticeInformation' => array('property' => 'showDetailedHoldNoticeInformation', 'type' => 'checkbox', 'label' => 'Show Detailed Hold Notice Information', 'description' => 'Whether or not the user should be presented with detailed hold notification information, i.e. you will receive an e-mail/phone call to xxx when the hold is available', 'hideInLists' => true, 'default' => 1), 'inSystemPickupsOnly' => array('property' => 'inSystemPickupsOnly', 'type' => 'checkbox', 'label' => 'In System Pickups Only', 'description' => 'Restrict pickup locations to only locations within the library system which is active.', 'hideInLists' => true), 'validPickupSystems' => array('property' => 'validPickupSystems', 'type' => 'text', 'label' => 'Valid Pickup Systems', 'description' => 'A list of library codes that can be used as pickup locations separated by pipes |', 'size' => '20', 'hideInLists' => true), 'holdDisclaimer' => array('property' => 'holdDisclaimer', 'type' => 'textarea', 'label' => 'Hold Disclaimer', 'description' => 'A disclaimer to display to patrons when they are placing a hold on items letting them know that their information may be available to other libraries.  Leave blank to not show a disclaimer.', 'hideInLists' => true))), 'loginSection' => array('property' => 'loginSection', 'type' => 'section', 'label' => 'Login', 'hideInLists' => true, 'properties' => array('showLoginButton' => array('property' => 'showLoginButton', 'type' => 'checkbox', 'label' => 'Show Login Button', 'description' => 'Whether or not the login button is displayed so patrons can login to the site', 'hideInLists' => true, 'default' => 1), 'allowPinReset' => array('property' => 'allowPinReset', 'type' => 'checkbox', 'label' => 'Allow PIN Reset', 'description' => 'Whether or not the user can reset their PIN if they forget it.', 'hideInLists' => true, 'default' => 0), 'loginFormUsernameLabel' => array('property' => 'loginFormUsernameLabel', 'type' => 'text', 'label' => 'Login Form Username Label', 'description' => 'The label to show for the username when logging in', 'size' => '50', 'hideInLists' => true, 'default' => 'Your Name'), 'loginFormPasswordLabel' => array('property' => 'loginFormPasswordLabel', 'type' => 'text', 'label' => 'Login Form Password Label', 'description' => 'The label to show for the password when logging in', 'size' => '50', 'hideInLists' => true, 'default' => 'Library Card Number'))), 'selfRegistrationSection' => array('property' => 'selfRegistrationSection', 'type' => 'section', 'label' => 'Self Registration', 'hideInLists' => true, 'properties' => array('enableSelfRegistration' => array('property' => 'enableSelfRegistration', 'type' => 'checkbox', 'label' => 'Enable Self Registration', 'description' => 'Whether or not patrons can self register on the site', 'hideInLists' => true), 'promptForBirthDateInSelfReg' => array('property' => 'promptForBirthDateInSelfReg', 'type' => 'checkbox', 'label' => 'Prompt For Birth Date', 'description' => 'Whether or not to prompt for birth date when self registering'), 'selfRegistrationFormMessage' => array('property' => 'selfRegistrationFormMessage', 'type' => 'html', 'label' => 'Self Registration Form Message', 'description' => 'Message shown to users with the form to submit the self registration.  Leave blank to give users the default message.', 'hideInLists' => true), 'selfRegistrationSuccessMessage' => array('property' => 'selfRegistrationSuccessMessage', 'type' => 'html', 'label' => 'Self Registration Success Message', 'description' => 'Message shown to users when the self registration has been completed successfully.  Leave blank to give users the default message.', 'hideInLists' => true), 'selfRegistrationTemplate' => array('property' => 'selfRegistrationTemplate', 'type' => 'text', 'label' => 'Self Registration Template', 'description' => 'The ILS template to use during self registration (Sierra and Millennium).', 'hideInLists' => true, 'default' => 'default'))))), array('property' => 'ecommerceSection', 'type' => 'section', 'label' => 'Fines/e-commerce', 'hideInLists' => true, 'properties' => array('showEcommerceLink' => array('property' => 'showEcommerceLink', 'type' => 'checkbox', 'label' => 'Show E-Commerce Link', 'description' => 'Whether or not users should be given a link to classic opac to pay fines', 'hideInLists' => true), 'payFinesLink' => array('property' => 'payFinesLink', 'type' => 'text', 'label' => 'Pay Fines Link', 'description' => 'The link to pay fines.  Leave as default to link to classic (should have eCommerce link enabled)', 'hideInLists' => true, 'default' => 'default', 'size' => 80), 'payFinesLinkText' => array('property' => 'payFinesLinkText', 'type' => 'text', 'label' => 'Pay Fines Link Text', 'description' => 'The text when linking to pay fines.', 'hideInLists' => true, 'default' => 'Click to Pay Fines Online ', 'size' => 80), 'minimumFineAmount' => array('property' => 'minimumFineAmount', 'type' => 'currency', 'displayFormat' => '%0.2f', 'label' => 'Minimum Fine Amount', 'description' => 'The minimum fine amount to display the e-commerce link', 'hideInLists' => true))), array('property' => 'searchingSection', 'type' => 'section', 'label' => 'Searching', 'hideInLists' => true, 'properties' => array('facetLabel' => array('property' => 'facetLabel', 'type' => 'text', 'label' => 'Facet Label', 'description' => 'The label for the library system in the Library System Facet.', 'size' => '40', 'hideInLists' => true), 'restrictSearchByLibrary' => array('property' => 'restrictSearchByLibrary', 'type' => 'checkbox', 'label' => 'Restrict Search By Library', 'description' => 'Whether or not search results should only include titles from this library', 'hideInLists' => true), 'econtentLocationsToInclude' => array('property' => 'econtentLocationsToInclude', 'type' => 'text', 'label' => 'eContent Locations To Include', 'description' => 'A list of eContent Locations to include within the scope.', 'size' => '40', 'hideInLists' => true), 'includeOutOfSystemExternalLinks' => array('property' => 'includeOutOfSystemExternalLinks', 'type' => 'checkbox', 'label' => 'Include Out Of System External Links', 'description' => 'Whether or not to include external links from other library systems.  Should only be enabled for global scope.', 'hideInLists' => true, 'default' => 0), 'boostByLibrary' => array('property' => 'boostByLibrary', 'type' => 'checkbox', 'label' => 'Boost By Library', 'description' => 'Whether or not boosting of titles owned by this library should be applied', 'hideInLists' => true), 'additionalLocalBoostFactor' => array('property' => 'additionalLocalBoostFactor', 'type' => 'integer', 'label' => 'Additional Local Boost Factor', 'description' => 'An additional numeric boost to apply to any locally owned and locally available titles', 'hideInLists' => true), 'restrictOwningBranchesAndSystems' => array('property' => 'restrictOwningBranchesAndSystems', 'type' => 'checkbox', 'label' => 'Restrict Owning Branch and System Facets to this library', 'description' => 'Whether or not the Owning Branch and Owning System Facets will only display values relevant to this library.', 'hideInLists' => true), 'showAvailableAtAnyLocation' => array('property' => 'showAvailableAtAnyLocation', 'type' => 'checkbox', 'label' => 'Show Available At Any Location?', 'description' => 'Whether or not to show any Marmot Location within the Available At facet', 'hideInLists' => true), 'repeatSearchOption' => array('property' => 'repeatSearchOption', 'type' => 'enum', 'values' => array('none' => 'None', 'librarySystem' => 'Library System', 'marmot' => 'Marmot'), 'label' => 'Repeat Search Options', 'description' => 'Where to allow repeating search. Valid options are: none, librarySystem, marmot, all'), 'systemsToRepeatIn' => array('property' => 'systemsToRepeatIn', 'type' => 'text', 'label' => 'Systems To Repeat In', 'description' => 'A list of library codes that you would like to repeat search in separated by pipes |.', 'size' => '20', 'hideInLists' => true), 'additionalLocationsToShowAvailabilityFor' => array('property' => 'additionalLocationsToShowAvailabilityFor', 'type' => 'text', 'label' => 'Additional Locations to Include in Available At Facet', 'description' => 'A list of library codes that you would like included in the available at facet separated by pipes |.', 'size' => '20', 'hideInLists' => true), 'availabilityToggleLabelSuperScope' => array('property' => 'availabilityToggleLabelSuperScope', 'type' => 'text', 'label' => 'SuperScope Toggle Label', 'description' => 'The label to show when viewing super scope i.e. Consortium Name / Entire Collection / Everything.  Does not show if superscope is not enabled.', 'default' => 'Entire Collection'), 'availabilityToggleLabelLocal' => array('property' => 'availabilityToggleLabelLocal', 'type' => 'text', 'label' => 'Local Collection Toggle Label', 'description' => 'The label to show when viewing the local collection i.e. Library Name / Local Collection.  Leave blank to hide the button.', 'default' => ''), 'availabilityToggleLabelAvailable' => array('property' => 'availabilityToggleLabelAvailable', 'type' => 'text', 'label' => 'Available Toggle Label', 'description' => 'The label to show when viewing available items i.e. Available Now / Available Locally / Available Here.', 'default' => 'Available Now'), 'repeatInOnlineCollection' => array('property' => 'repeatInOnlineCollection', 'type' => 'checkbox', 'label' => 'Repeat In Online Collection', 'description' => 'Turn on to allow repeat search in the Online Collection.', 'hideInLists' => true, 'default' => false), 'showMarmotResultsAtEndOfSearch' => array('property' => 'showMarmotResultsAtEndOfSearch', 'type' => 'checkbox', 'label' => 'Show Consortium Results at the end of Scoped Searches', 'description' => 'Whether or not the Pika should show search results from the entire Consortium at the end of scoped searches.', 'hideInLists' => true, 'default' => 1), 'showAdvancedSearchbox' => array('property' => 'showAdvancedSearchbox', 'type' => 'checkbox', 'label' => 'Show Advanced Search Link', 'description' => 'Whether or not users should see the advanced search link next to the search box.  It will still appear in the footer.', 'hideInLists' => true, 'default' => 1), 'applyNumberOfHoldingsBoost' => array('property' => 'applyNumberOfHoldingsBoost', 'type' => 'checkbox', 'label' => 'Apply Number Of Holdings Boost', 'description' => 'Whether or not the relevance will use boosting by number of holdings in the catalog.', 'hideInLists' => true, 'default' => 1), 'showSearchTools' => array('property' => 'showSearchTools', 'type' => 'checkbox', 'label' => 'Show Search Tools', 'description' => 'Turn on to activate search tools (save search, export to excel, rss feed, etc).', 'hideInLists' => true), 'recordsToBlackList' => array('property' => 'recordsToBlackList', 'type' => 'textarea', 'label' => 'Records to deaccession', 'description' => 'A list of records to deaccession (hide) in search results.  Enter one record per line.', 'hideInLists' => true))), array('property' => 'enrichmentSection', 'type' => 'section', 'label' => 'Catalog Enrichment', 'hideInLists' => true, 'properties' => array('showStandardReviews' => array('property' => 'showStandardReviews', 'type' => 'checkbox', 'label' => 'Show Standard Reviews', 'description' => 'Whether or not reviews from Content Cafe/Syndetics are displayed on the full record page.', 'hideInLists' => true, 'default' => 1), 'showGoodReadsReviews' => array('property' => 'showGoodReadsReviews', 'type' => 'checkbox', 'label' => 'Show GoodReads Reviews', 'description' => 'Whether or not reviews from GoodReads are displayed on the full record page.', 'hideInLists' => true, 'default' => true), 'preferSyndeticsSummary' => array('property' => 'preferSyndeticsSummary', 'type' => 'checkbox', 'label' => 'Prefer Syndetics Summary', 'description' => 'Whether or not the Syndetics Summary should be preferred over the Summary in the Marc Record.', 'hideInLists' => true, 'default' => 1), 'showSimilarAuthors' => array('property' => 'showSimilarAuthors', 'type' => 'checkbox', 'label' => 'Show Similar Authors', 'description' => 'Whether or not Similar Authors from Novelist is shown.', 'default' => 1, 'hideInLists' => true), 'showSimilarTitles' => array('property' => 'showSimilarTitles', 'type' => 'checkbox', 'label' => 'Show Similar Titles', 'description' => 'Whether or not Similar Titles from Novelist is shown.', 'default' => 1, 'hideInLists' => true), 'showGoDeeper' => array('property' => 'showGoDeeper', 'type' => 'checkbox', 'label' => 'Show Go Deeper', 'description' => 'Whether or not Go Deeper link is shown in full record page', 'default' => 1, 'hideInLists' => true), 'showRatings' => array('property' => 'showRatings', 'type' => 'checkbox', 'label' => 'Show Ratings', 'description' => 'Whether or not ratings are shown', 'hideInLists' => true, 'default' => 1), 'showFavorites' => array('property' => 'showFavorites', 'type' => 'checkbox', 'label' => 'Show Favorites', 'description' => 'Whether or not users can maintain favorites lists', 'hideInLists' => true, 'default' => 1), 'showOtherEditionsPopup' => array('property' => 'showOtherEditionsPopup', 'type' => 'checkbox', 'label' => 'Show Other Editions Popup', 'description' => 'Whether or not the Other Formats and Langauges popup will be shown (if not shows Other Editions sidebar)', 'default' => '1', 'hideInLists' => true), 'showWikipediaContent' => array('property' => 'showWikipediaContent', 'type' => 'checkbox', 'label' => 'Show Wikipedia Content', 'description' => 'Whether or not Wikipedia content should be shown on author page', 'default' => '1', 'hideInLists' => true))), array('property' => 'fullRecordSection', 'type' => 'section', 'label' => 'Full Record Display', 'hideInLists' => true, 'properties' => array('showTextThis' => array('property' => 'showTextThis', 'type' => 'checkbox', 'label' => 'Show Text This', 'description' => 'Whether or not the Text This link is shown', 'hideInLists' => true, 'default' => 1), 'showEmailThis' => array('property' => 'showEmailThis', 'type' => 'checkbox', 'label' => 'Show Email This', 'description' => 'Whether or not the Email This link is shown', 'hideInLists' => true, 'default' => 1), 'showShareOnExternalSites' => array('property' => 'showShareOnExternalSites', 'type' => 'checkbox', 'label' => 'Show Sharing To External Sites', 'description' => 'Whether or not sharing on external sites (Twitter, Facebook, Pinterest, etc. is shown)', 'hideInLists' => true, 'default' => 1), 'showQRCode' => array('property' => 'showQRCode', 'type' => 'checkbox', 'label' => 'Show QR Code', 'description' => 'Whether or not the catalog should show a QR Code in full record view', 'hideInLists' => true, 'default' => 1), 'showComments' => array('property' => 'showComments', 'type' => 'checkbox', 'label' => 'Show Comments', 'description' => 'Whether or not user comments are shown (also disables adding comments)', 'hideInLists' => true, 'default' => 1), 'hideCommentsWithBadWords' => array('property' => 'hideCommentsWithBadWords', 'type' => 'checkbox', 'label' => 'Hide Comments with Bad Words', 'description' => 'If checked, any comments with bad words are completely removed from the user interface for everyone except the original poster.', 'hideInLists' => true), 'showTagging' => array('property' => 'showTagging', 'type' => 'checkbox', 'label' => 'Show Tagging', 'description' => 'Whether or not tags are shown (also disables adding tags)', 'hideInLists' => true, 'default' => 1), 'showTableOfContentsTab' => array('property' => 'showTableOfContentsTab', 'type' => 'checkbox', 'label' => 'Show Table of Contents Tab', 'description' => 'Whether or not a separate tab will be shown for table of contents 505 field.', 'hideInLists' => true, 'default' => 1), 'notesTabName' => array('property' => 'notesTabName', 'type' => 'text', 'label' => 'Notes Tab Name', 'description' => 'Text to display for the the notes tab.', 'size' => '40', 'maxLength' => '50', 'hideInLists' => true, 'default' => 'Notes'), 'exportOptions' => array('property' => 'exportOptions', 'type' => 'text', 'label' => 'Export Options', 'description' => 'A list of export options that should be enabled separated by pipes.  Valid values are currently RefWorks and EndNote.', 'size' => '40', 'hideInLists' => true), 'show856LinksAsTab' => array('property' => 'show856LinksAsTab', 'type' => 'checkbox', 'label' => 'Show 856 Links as Tab', 'description' => 'Whether or not 856 links will be shown in their own tab or on the same tab as holdings.', 'hideInLists' => true, 'default' => 1), 'showProspectorTitlesAsTab' => array('property' => 'showProspectorTitlesAsTab', 'type' => 'checkbox', 'label' => 'Show Prospector Titles as Tab', 'description' => 'Whether or not Prospector TItles links will be shown in their own tab or in the sidebar in full record view.', 'default' => 1, 'hideInLists' => true), 'showCheckInGrid' => array('property' => 'showCheckInGrid', 'type' => 'checkbox', 'label' => 'Show Check-in Grid', 'description' => 'Whether or not the check-in grid is shown for periodicals.', 'default' => 1, 'hideInLists' => true), 'showStaffView' => array('property' => 'showStaffView', 'type' => 'checkbox', 'label' => 'Show Staff View', 'description' => 'Whether or not the staff view is displayed in full record view.', 'hideInLists' => true, 'default' => true), 'showInMainDetails' => array('property' => 'showInMainDetails', 'type' => 'multiSelect', 'label' => 'Which details to show in the main/top details section : ', 'description' => 'Selected details will be shown in the top/main section of the full record view. Details not selected are moved to the More Details accordion.', 'listStyle' => 'checkboxSimple', 'values' => self::$showInMainDetailsOptions), 'moreDetailsOptions' => array('property' => 'moreDetailsOptions', 'type' => 'oneToMany', 'label' => 'Full Record Options', 'description' => 'Record Options for the display of full record', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'LibraryMoreDetails', 'structure' => $libraryMoreDetailsStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true))), array('property' => 'holdingsSummarySection', 'type' => 'section', 'label' => 'Holdings Summary', 'hideInLists' => true, 'properties' => array('showCopiesLineInHoldingsSummary' => array('property' => 'showCopiesLineInHoldingsSummary', 'type' => 'checkbox', 'label' => 'Show Copies Line In Holdings Summary', 'description' => 'Whether or not the number of copies should be shown in the holdins summary', 'default' => '1', 'hideInLists' => true), 'showItsHere' => array('property' => 'showItsHere', 'type' => 'checkbox', 'label' => 'Show It\'s Here', 'description' => 'Whether or not the holdings summray should show It\'s here based on IP and the currently logged in patron\'s location.', 'hideInLists' => true, 'default' => 1))), array('property' => 'materialsRequestSection', 'type' => 'section', 'label' => 'Materials Request', 'hideInLists' => true, 'properties' => array('enableMaterialsRequest' => array('property' => 'enableMaterialsRequest', 'type' => 'checkbox', 'label' => 'Enable Pika Materials Request System', 'description' => 'Enable Materials Request functionality so patrons can request items not in the catalog.', 'hideInLists' => true), 'externalMaterialsRequestUrl' => array('property' => 'externalMaterialsRequestUrl', 'type' => 'text', 'label' => 'External Materials Request URL', 'description' => 'A link to an external Materials Request System to be used instead of the built in Pika system', 'hideInList' => true), 'maxRequestsPerYear' => array('property' => 'maxRequestsPerYear', 'type' => 'integer', 'label' => 'Max Requests Per Year', 'description' => 'The maximum number of requests that a user can make within a year', 'hideInLists' => true, 'default' => 60), 'maxOpenRequests' => array('property' => 'maxOpenRequests', 'type' => 'integer', 'label' => 'Max Open Requests', 'description' => 'The maximum number of requests that a user can have open at one time', 'hideInLists' => true, 'default' => 5))), array('property' => 'goldrushSection', 'type' => 'section', 'label' => 'Gold Rush', 'hideInLists' => true, 'properties' => array('goldRushCode' => array('property' => 'goldRushCode', 'type' => 'text', 'label' => 'Gold Rush Inst Code', 'description' => 'The INST Code to use with Gold Rush.  Leave blank to not link to Gold Rush.', 'hideInLists' => true))), array('property' => 'prospectorSection', 'type' => 'section', 'label' => 'Prospector', 'hideInLists' => true, 'properties' => array('repeatInProspector' => array('property' => 'repeatInProspector', 'type' => 'checkbox', 'label' => 'Repeat In Prospector', 'description' => 'Turn on to allow repeat search in Prospector functionality.', 'hideInLists' => true, 'default' => 1), 'prospectorCode' => array('property' => 'prospectorCode', 'type' => 'text', 'label' => 'Prospector Code', 'description' => 'The code used to identify this location within Prospector. Leave blank if items for this location are not in Prospector.', 'hideInLists' => true), 'enablePospectorIntegration' => array('property' => 'enablePospectorIntegration', 'type' => 'checkbox', 'label' => 'Enable Prospector Integration', 'description' => 'Whether or not Prospector Integrations should be displayed for this library.', 'hideInLists' => true, 'default' => 1), 'showProspectorResultsAtEndOfSearch' => array('property' => 'showProspectorResultsAtEndOfSearch', 'type' => 'checkbox', 'label' => 'Show Prospector Results At End Of Search', 'description' => 'Whether or not Prospector Search Results should be shown at the end of search results.', 'hideInLists' => true, 'default' => 1))), array('property' => 'worldCatSection', 'type' => 'section', 'label' => 'WorldCat', 'hideInLists' => true, 'properties' => array('repeatInWorldCat' => array('property' => 'repeatInWorldCat', 'type' => 'checkbox', 'label' => 'Repeat In WorldCat', 'description' => 'Turn on to allow repeat search in WorldCat functionality.', 'hideInLists' => true), 'worldCatUrl' => array('property' => 'worldCatUrl', 'type' => 'text', 'label' => 'WorldCat URL', 'description' => 'A custom World Cat URL to use while searching.', 'hideInLists' => true, 'size' => '80'), 'worldCatQt' => array('property' => 'worldCatQt', 'type' => 'text', 'label' => 'WorldCat QT', 'description' => 'A custom World Cat QT term to use while searching.', 'hideInLists' => true, 'size' => '40'))), array('property' => 'overdriveSection', 'type' => 'section', 'label' => 'OverDrive', 'hideInLists' => true, 'properties' => array('enableOverdriveCollection' => array('property' => 'enableOverdriveCollection', 'type' => 'checkbox', 'label' => 'Enable Overdrive Collection', 'description' => 'Whether or not titles from the Overdrive collection should be included in searches', 'hideInLists' => true), 'repeatInOverdrive' => array('property' => 'repeatInOverdrive', 'type' => 'checkbox', 'label' => 'Repeat In Overdrive', 'description' => 'Turn on to allow repeat search in Overdrive functionality.', 'hideInLists' => true, 'default' => 0), 'overdriveAuthenticationILSName' => array('property' => 'overdriveAuthenticationILSName', 'type' => 'text', 'label' => 'The ILS Name Overdrive uses for user Authentication', 'description' => 'The name of the ILS that OverDrive uses to authenticate users logging into the Overdrive website.', 'size' => '20', 'hideInLists' => true), 'overdriveRequirePin' => array('property' => 'overdriveRequirePin', 'type' => 'checkbox', 'label' => 'Is a Pin Required to log into Overdrive website?', 'description' => 'Turn on to allow repeat search in Overdrive functionality.', 'hideInLists' => true, 'default' => 0), 'overdriveAdvantageName' => array('property' => 'overdriveAdvantageName', 'type' => 'text', 'label' => 'Overdrive Advantage Name', 'description' => 'The name of the OverDrive Advantage account if any.', 'size' => '80', 'hideInLists' => true), 'overdriveAdvantageProductsKey' => array('property' => 'overdriveAdvantageProductsKey', 'type' => 'text', 'label' => 'Overdrive Advantage Products Key', 'description' => 'The products key for use when building urls to the API from the advantageAccounts call.', 'size' => '80', 'hideInLists' => false))), array('property' => 'hooplaSection', 'type' => 'section', 'label' => 'Hoopla', 'hideInLists' => true, 'properties' => array('includeHoopla' => array('property' => 'includeHoopla', 'type' => 'checkbox', 'label' => 'Include Hoopla content in search results', 'description' => 'Whether or not Hoopla data should be included for this library.', 'hideInLists' => true, 'default' => 0))), array('property' => 'dplaSection', 'type' => 'section', 'label' => 'DPLA', 'hideInLists' => true, 'properties' => array('includeDplaResults' => array('property' => 'includeDplaResults', 'type' => 'checkbox', 'label' => 'Include DPLA content in search results', 'description' => 'Whether or not DPLA data should be included for this library.', 'hideInLists' => true, 'default' => 0))), 'holidays' => array('property' => 'holidays', 'type' => 'oneToMany', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'Holiday', 'structure' => $holidaysStructure, 'label' => 'Holidays', 'description' => 'Holidays', 'sortable' => false, 'storeDb' => true), 'nearbyBookStores' => array('property' => 'nearbyBookStores', 'type' => 'oneToMany', 'label' => 'Nearby Book Stores', 'description' => 'A list of book stores to search', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'NearbyBookStore', 'structure' => $nearbyBookStoreStructure, 'sortable' => true, 'storeDb' => true), 'facets' => array('property' => 'facets', 'type' => 'oneToMany', 'label' => 'Facets', 'description' => 'A list of facets to display in search results', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'LibraryFacetSetting', 'structure' => $facetSettingStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true), 'searchSources' => array('property' => 'searchSources', 'type' => 'oneToMany', 'label' => 'Search Sources', 'description' => 'Searches to display to the user', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'LibrarySearchSource', 'structure' => $searchSourceStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true), 'browseCategories' => array('property' => 'browseCategories', 'type' => 'oneToMany', 'label' => 'Browse Categories', 'description' => 'Browse Categories To Show on the Home Screen', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'LibraryBrowseCategory', 'structure' => $libraryBrowseCategoryStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => false, 'canEdit' => false), 'libraryLinks' => array('property' => 'libraryLinks', 'type' => 'oneToMany', 'label' => 'Sidebar Links', 'description' => 'Links To Show in the sidebar', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'LibraryLinks', 'structure' => $libraryLinksStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => false, 'canEdit' => false), 'libraryTopLinks' => array('property' => 'libraryTopLinks', 'type' => 'oneToMany', 'label' => 'Header Links', 'description' => 'Links To Show in the header', 'keyThis' => 'libraryId', 'keyOther' => 'libraryId', 'subObjectType' => 'LibraryTopLinks', 'structure' => $libraryTopLinksStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => false, 'canEdit' => false));
     foreach ($structure as $fieldName => $field) {
         if (isset($field['property'])) {
             $field['propertyOld'] = $field['property'] . 'Old';
             $structure[$fieldName] = $field;
         }
     }
     return $structure;
 }
예제 #7
0
 function getListWidget()
 {
     global $interface;
     global $user;
     if (isset($_REQUEST['username']) && isset($_REQUEST['password'])) {
         $username = $_REQUEST['username'];
         $password = $_REQUEST['password'];
         $user = UserAccount::validateAccount($username, $password);
         $interface->assign('user', $user);
     }
     //Load the widget configuration
     require_once ROOT_DIR . '/sys/ListWidget.php';
     require_once ROOT_DIR . '/sys/ListWidgetList.php';
     require_once ROOT_DIR . '/sys/ListWidgetListsLinks.php';
     $widget = new ListWidget();
     $id = $_REQUEST['id'];
     $widget->id = $id;
     if ($widget->find(true)) {
         $interface->assign('widget', $widget);
         //return the widget
         return $interface->fetch('ListWidget/listWidget.tpl');
     }
 }
예제 #8
0
 /**
  * Constructs the widget by defining a special template.
  */
 public function __construct()
 {
     parent::__construct();
     $this->addCSSClass('widget-links');
 }
예제 #9
0
 function getAddToWidgetForm()
 {
     global $interface;
     global $user;
     // Display Page
     $interface->assign('id', strip_tags($_REQUEST['id']));
     $interface->assign('source', strip_tags($_REQUEST['source']));
     $interface->assign('popupTitle', 'Create a Widget');
     $existingWidgets = array();
     $listWidget = new ListWidget();
     if ($user->hasRole('libraryAdmin') || $user->hasRole('contentEditor')) {
         //Get all widgets for the library
         $userLibrary = Library::getPatronHomeLibrary();
         $listWidget->libraryId = $userLibrary->libraryId;
     }
     $listWidget->find();
     while ($listWidget->fetch()) {
         $existingWidgets[$listWidget->id] = $listWidget->name;
     }
     $interface->assign('existingWidgets', $existingWidgets);
     $pageContent = $interface->fetch('Admin/addToWidgetForm.tpl');
     $interface->assign('popupContent', $pageContent);
     echo $interface->fetch('popup-wrapper.tpl');
 }
예제 #10
0
 function launch()
 {
     global $configArray;
     global $interface;
     global $user;
     $interface->assign('canAddNew', $this->canAddNew());
     $interface->assign('canDelete', $this->canDelete());
     $interface->assign('showReturnToList', $this->showReturnToList());
     $interface->assign('showExportAndCompare', $this->showExportAndCompare());
     //Figure out what mode we are in
     if (isset($_REQUEST['objectAction'])) {
         $objectAction = $_REQUEST['objectAction'];
     } else {
         $objectAction = 'list';
     }
     if ($objectAction == 'delete' && isset($_REQUEST['id'])) {
         parent::launch();
         exit;
     }
     //Get all available widgets
     $availableWidgets = array();
     $listWidget = new ListWidget();
     if ($user->hasRole('libraryAdmin') || $user->hasRole('contentEditor')) {
         $homeLibrary = Library::getPatronHomeLibrary();
         $listWidget->libraryId = $homeLibrary->libraryId;
     }
     $listWidget->orderBy('name ASC');
     $listWidget->find();
     while ($listWidget->fetch()) {
         $availableWidgets[$listWidget->id] = clone $listWidget;
     }
     $interface->assign('availableWidgets', $availableWidgets);
     //Get the selected widget
     if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) {
         $widget = $availableWidgets[$_REQUEST['id']];
         $interface->assign('object', $widget);
     }
     //Do actions that require preprocessing
     if ($objectAction == 'save') {
         if (!isset($widget)) {
             $widget = new ListWidget();
         }
         DataObjectUtil::updateFromUI($widget, $listWidget->getObjectStructure());
         $validationResults = DataObjectUtil::saveObject($listWidget->getObjectStructure(), "ListWidget");
         if (!$validationResults['validatedOk']) {
             $interface->assign('object', $widget);
             $interface->assign('errors', $validationResults['errors']);
             $objectAction = 'edit';
         } else {
             $interface->assign('object', $validationResults['object']);
             $objectAction = 'view';
         }
     }
     if ($objectAction == 'list') {
         $interface->setTemplate('listWidgets.tpl');
     } else {
         if ($objectAction == 'edit' || $objectAction == 'add') {
             if (isset($_REQUEST['id'])) {
                 $interface->assign('widgetid', $_REQUEST['id']);
                 $interface->assign('id', $_REQUEST['id']);
             }
             $editForm = DataObjectUtil::getEditForm($listWidget->getObjectStructure());
             $interface->assign('editForm', $editForm);
             $interface->setTemplate('listWidgetEdit.tpl');
         } else {
             $interface->setTemplate('listWidget.tpl');
         }
     }
     $interface->setPageTitle('List Widgets');
     $interface->display('layout.tpl');
 }
예제 #11
0
 function getAddToWidgetForm()
 {
     global $interface;
     global $user;
     // Display Page
     $interface->assign('id', strip_tags($_REQUEST['id']));
     $interface->assign('source', strip_tags($_REQUEST['source']));
     $existingWidgets = array();
     $listWidget = new ListWidget();
     if ($user->hasRole('libraryAdmin') || $user->hasRole('contentEditor')) {
         //Get all widgets for the library
         $userLibrary = Library::getPatronHomeLibrary();
         $listWidget->libraryId = $userLibrary->libraryId;
     }
     $listWidget->find();
     while ($listWidget->fetch()) {
         $existingWidgets[$listWidget->id] = $listWidget->name;
     }
     $interface->assign('existingWidgets', $existingWidgets);
     $results = array('title' => 'Create a Widget', 'modalBody' => $interface->fetch('Admin/addToWidgetForm.tpl'), 'modalButtons' => "<span class='tool btn btn-primary' onclick='\$(\"#bulkAddToList\").submit();'>Create Widget</span>");
     return json_encode($results);
 }
 private function launchEdit($widgetId, $widgetListId)
 {
     global $configArray;
     global $interface;
     $interface->setPageTitle('List Widgets');
     //Get Info about the Widget
     $widget = new ListWidget();
     $widget->whereAdd('id = ' . $widgetId);
     $widget->find();
     $widget->fetch();
     $interface->assign('widgetName', $widget->name);
     $interface->assign('widgetId', $widget->id);
     //Get Info about the current TAB
     $widgetList = new ListWidgetList();
     $widgetList->whereAdd('id = ' . $widgetListId);
     $widgetList->find();
     $widgetList->fetch();
     $interface->assign('widgetListName', $widgetList->name);
     //Get all available links
     $availableLinks = array();
     $listWidgetLinks = new ListWidgetListsLinks();
     $listWidgetLinks->whereAdd('listWidgetListsId = ' . $widgetListId);
     $listWidgetLinks->orderBy('weight ASC');
     $listWidgetLinks->find();
     while ($listWidgetLinks->fetch()) {
         $availableLinks[$listWidgetLinks->id] = clone $listWidgetLinks;
     }
     $interface->assign('availableLinks', $availableLinks);
     $interface->setTemplate('listWidgetListLinks.tpl');
 }
예제 #13
0
 public function __construct()
 {
     parent::__construct();
     $this->addCSSClass('infobox-widget');
     $this->layout = 'sidebar/infobox-layout.php';
 }
예제 #14
0
 function launch()
 {
     global $interface;
     global $user;
     $interface->assign('canAddNew', $this->canAddNew());
     $interface->assign('canDelete', $this->canDelete());
     $interface->assign('showReturnToList', $this->showReturnToList());
     $interface->assign('showExportAndCompare', $this->showExportAndCompare());
     //Figure out what mode we are in
     if (isset($_REQUEST['objectAction'])) {
         $objectAction = $_REQUEST['objectAction'];
     } else {
         $objectAction = 'list';
     }
     if ($objectAction == 'delete' && isset($_REQUEST['id'])) {
         parent::launch();
         exit;
     }
     //Get all available widgets
     $availableWidgets = array();
     $listWidget = new ListWidget();
     if ($user->hasRole('libraryAdmin') || $user->hasRole('contentEditor')) {
         $homeLibrary = Library::getPatronHomeLibrary();
         $listWidget->libraryId = $homeLibrary->libraryId;
     }
     $listWidget->orderBy('name ASC');
     $listWidget->find();
     while ($listWidget->fetch()) {
         $availableWidgets[$listWidget->id] = clone $listWidget;
     }
     $interface->assign('availableWidgets', $availableWidgets);
     //Get the selected widget
     if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) {
         $widget = $availableWidgets[$_REQUEST['id']];
         $interface->assign('object', $widget);
     }
     //Do actions that require pre-processing
     if ($objectAction == 'save') {
         if (!isset($widget)) {
             $widget = new ListWidget();
         }
         DataObjectUtil::updateFromUI($widget, $listWidget->getObjectStructure());
         $validationResults = DataObjectUtil::saveObject($listWidget->getObjectStructure(), "ListWidget");
         if (!$validationResults['validatedOk']) {
             $interface->assign('object', $widget);
             $interface->assign('errors', $validationResults['errors']);
             $objectAction = 'edit';
         } else {
             $interface->assign('object', $validationResults['object']);
             $objectAction = 'view';
         }
     }
     if ($objectAction == 'list') {
         $interface->setTemplate('listWidgets.tpl');
     } else {
         if ($objectAction == 'edit' || $objectAction == 'add') {
             if (isset($_REQUEST['id'])) {
                 $interface->assign('widgetid', $_REQUEST['id']);
                 $interface->assign('id', $_REQUEST['id']);
             }
             $editForm = DataObjectUtil::getEditForm($listWidget->getObjectStructure());
             $interface->assign('editForm', $editForm);
             $interface->setTemplate('listWidgetEdit.tpl');
         } else {
             // Set some default sizes for the iframe we embed on the view page
             switch ($widget->style) {
                 case 'horizontal':
                     $width = 650;
                     $height = 275;
                     break;
                 case 'vertical':
                     $width = 175;
                     $height = 400;
                     break;
                 case 'text-list':
                     $width = 400;
                     $height = 200;
                     break;
                 case 'single':
                 case 'single-with-next':
                     $width = 225;
                     $height = 275;
                     break;
             }
             $interface->assign('width', $width);
             $interface->assign('height', $height);
             $interface->setTemplate('listWidget.tpl');
         }
     }
     $interface->assign('sidebar', 'MyAccount/account-sidebar.tpl');
     $interface->setPageTitle('List Widgets');
     $interface->display('layout.tpl');
 }
예제 #15
0
 public function __construct()
 {
     parent::__construct();
     $this->addCSSClass('widget-options');
     $this->title = _('Einstellungen');
 }
예제 #16
0
파일: wiki.inc.php 프로젝트: ratbird/hope
/**
* Returns an infobox string holding information and action links for
* current page.
* If newest version is displayed, infobox includes backlinks.
*
* @param    string  WikiPage name
* @param    bool    Is version displayed latest version?
*
**/
function getShowPageInfobox($keyword, $latest_version)
{
    $versions = getWikiPageVersions($keyword);

    if (!$latest_version) {
        $message = sprintf(_('Sie betrachten eine alte Version, die nicht mehr geändert werden kann. Verwenden Sie dazu die %saktuelle Version%s.'),
                           '<a href="' . URLHelper::getLink('?keyword='.urlencode($keyword)) . '">',
                           '</a>');
        PageLayout::postMessage(MessageBox::info($message));
    }

    $sidebar = Sidebar::get();

    // Table of Contents/QuickLinks
    $widget = new ListWidget();
    $widget->setTitle(_('QuickLinks'));

    $toccont = get_toc_content();
    $toccont_empty = !trim(strip_tags($toccont));
    if ($GLOBALS['perm']->have_studip_perm('autor', $GLOBALS['SessSemName'][1])){
        $extra = sprintf('<a href="%s">%s</a>',
                         URLHelper::getLink('?keyword=toc&view=edit'),
                         $toccont_empty
                             ? Icon::create('add', 'clickable', ['title' => _('erstellen')])->asImg()
                             : Icon::create('edit', 'clickable', ['title' => _('bearbeiten')])->asImg());
        $widget->setExtra($extra);
    }

    $element = new WidgetElement($toccont_empty ? _('Keine QuickLinks vorhanden') : $toccont);
    $element->icon = Icon::create('link-intern', 'clickable');
    $widget->addElement($element);
    $sidebar->addWidget($widget);

    // Backlinks
    if ($latest_version) {
        $widget = new LinksWidget();
        $widget->setTitle(_('Seiten, die auf diese Seite verweisen'));
        foreach(getBacklinks($keyword) as $backlink) {
            $widget->addLink($backlink, URLHelper::getLink('?keyword=' . urlencode($backlink)));
        }
        $sidebar->addWidget($widget);
    }

    // Ansichten
    $widget = new ViewsWidget();
    $widget->addLink(_('Standard'),
                     URLHelper::getLink('?keyword=' . urlencode($keyword) . '&view=show'),
                     Icon::create('wiki', 'clickable'))
           ->setActive(true);
    if (count($versions) >= 1) {
        $widget->addLink(_('Textänderungen anzeigen'),
                         URLHelper::getLink('?keyword=' . urlencode($keyword) . '&view=diff'));
        $widget->addLink(_('Text mit Autor/-innenzuordnung anzeigen'),
                         URLHelper::getLink('?keyword=' . urlencode($keyword) . '&view=combodiff'));
    }
    $sidebar->addWidget($widget);

    // Suche
    $widget = new SearchWidget(URLHelper::getLink('?view=search&keyword=' . urlencode($keyword)));
    $widget->addNeedle(_('Im Wiki suchen'), 'searchfor', true);
    $widget->addFilter(_('Nur in aktuellen Versionen'), 'searchcurrentversions');
    $sidebar->addWidget($widget);

    // Versionen
    if (count($versions) > 0) {
        $widget = new SelectWidget(_('Alte Versionen dieser Seite'),
                                   URLHelper::getLink('?keyword=' . urlencode($keyword)),
                                   'version');
        $widget->addElement(new SelectElement('', _('Aktuelle Version')));
        foreach ($versions as $version) {
            $element = new SelectElement($version['version'],
                                         sprintf(_('Version %u (%s)'),
                                                 $version['version'],
                                                 date('d.m.Y, H:i', $version['chdate'])),
                                         $version['version'] == Request::int('version', 0));
            $widget->addElement($element);
        }
        $sidebar->addWidget($widget);
    }

    // Kommentare
    $widget = new OptionsWidget();
    $widget->setTitle(_('Kommentare'));
    $widget->addRadioButton(_('einblenden'),
                            URLHelper::getLink('?keyword=' . urlencode($keyword) . '&wiki_comments=all'),
                            $GLOBALS['show_wiki_comments'] === 'all');
    $widget->addRadioButton(_('als Icons einblenden'),
                            URLHelper::getLink('?keyword=' . urlencode($keyword) . '&wiki_comments=icon'),
                            $GLOBALS['show_wiki_comments'] === 'icon');
    $widget->addRadioButton(_('ausblenden'),
                            URLHelper::getLink('?keyword=' . urlencode($keyword) . '&wiki_comments=none'),
                            $GLOBALS['show_wiki_comments'] === 'none');
    $sidebar->addWidget($widget, 'comments');

    // Exportfunktionen
    $version = Request::int('version') ?: '';

    $widget = new ExportWidget();
    $widget->addLink(_('Druckansicht'),
                     URLHelper::getLink('?keyword=' . urlencode($keyword) . '&version=' . $version . '&view=wikiprint'),
                     Icon::create('print', 'clickable'),
                     array('target' => '_blank'));
    $widget->addLink(_('PDF-Ausgabe'),
                     URLHelper::getLink('?keyword=' . urlencode($keyword) . '&version=' . $version . '&view=export_pdf'),
                     Icon::create('file-pdf', 'clickable'),
                     array('target' => '_blank'));
    $sidebar->addWidget($widget);

    return array();
}