Exemplo n.º 1
0
 public function append_preferences($context)
 {
     # Add new fieldset
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'CacheLite'));
     # Add Site Reference field
     $label = Widget::Label('Cache Period');
     $label->appendChild(Widget::Input('settings[cachelite][lifetime]', General::Sanitize($this->_get_lifetime())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Length of cache period in seconds.', array('class' => 'help')));
     $label = Widget::Label('Excluded URLs');
     $label->appendChild(Widget::Textarea('cachelite[excluded-pages]', 10, 50, $this->_get_excluded_pages()));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Add a line for each URL you want to be excluded from the cache. Add a <code>*</code> to the end of the URL for wildcard matches.', array('class' => 'help')));
     $label = Widget::Label();
     $input = Widget::Input('settings[cachelite][show-comments]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('show-comments', 'cachelite') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Show comments in page source?');
     $group->appendChild($label);
     $label = Widget::Label();
     $input = Widget::Input('settings[cachelite][backend-delegates]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('backend-delegates', 'cachelite') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Expire cache when entries are created/updated through the backend?');
     $group->appendChild($label);
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 2
0
 public function append_preferences($context)
 {
     # Add new fieldset
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'PayPal Payments'));
     # Add Merchant Email field
     $label = Widget::Label('Merchant Email/Account ID');
     $label->appendChild(Widget::Input('settings[paypal-payments][business]', General::Sanitize($this->_get_paypal_business())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'The merchant email address or account ID of the payment recipient.', array('class' => 'help')));
     # Country <select>
     $countries = array('Australia', 'United Kingdom', 'United States');
     $selected_country = $this->_get_country();
     foreach ($countries as $country) {
         $selected = $country == $selected_country ? TRUE : FALSE;
         $options[] = array($country, $selected);
     }
     $label = Widget::Label();
     $select = Widget::Select('settings[paypal-payments][country]', $options);
     $label->setValue('PayPal Country' . $select->generate());
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Country you want to target.', array('class' => 'help')));
     # Sandbox
     $label = Widget::Label();
     $input = Widget::Input('settings[paypal-payments][sandbox]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('sandbox', 'paypal-payments') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Enable testing mode');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Directs payments to PayPal’s Sandbox: <code>http://www.sandbox.paypal.com/</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 3
0
 public function addCustomPreferenceFieldsets($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Can Of Spam Filter'));
     $uniqueID = Widget::Label('Unique ID');
     $uniqueID->appendChild(Widget::Input('settings[canofspam][uniqueid]', General::Sanitize($this->getUniqueID())));
     $group->appendChild($uniqueID);
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 4
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Admin Rainbow Headline'));
     $label = Widget::Label('Headline Background Color');
     $label->appendChild(Widget::Input('settings[admin_rainbow_headline][headline_color]', General::Sanitize(Administration::instance()->Configuration->get('headline_color', 'admin_rainbow_headline'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'This can be any RGB-Hexvalue, for example <code>#97712B</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Language Redirect')));
     $label = Widget::Label(__('Language codes'));
     $label->appendChild(Widget::Input('settings[language_redirect][language_codes]', General::Sanitize(Symphony::Configuration()->get('language_codes', 'language_redirect'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', __('Comma separated list of supported language codes. First language ist the default language. Leave empty to disable <code>.htaccess</code>-rules.'), array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 6
0
 public function __construct()
 {
     $this->path = General::Sanitize(Symphony::Configuration()->get('path', 'dump_db'));
     $this->format = General::Sanitize(Symphony::Configuration()->get('format', 'dump_db'));
     if ($this->format == "") {
         $this->format = '%1$s.sql';
     }
     if ($this->path == "") {
         $this->path = "/workspace";
     }
 }
Exemplo n.º 7
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Akismet Spam Filtering'));
     $label = Widget::Label('Wordpress API Key');
     $label->appendChild(Widget::Input('settings[akismet][api-key]', General::Sanitize($this->getWordpressApiKey())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Get a Wordpress API key from the <a href="http://wordpress.com/api-keys/">Wordpress site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Map Location Field'));
     $label = Widget::Label('Google Maps API Key');
     $label->appendChild(Widget::Input('settings[map-location-field][google-api-key]', General::Sanitize($context['parent']->Configuration->get('google-api-key', 'map-location-field'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Get a Google Maps API key from the <a href="http://code.google.com/apis/maps/index.html">Google Maps site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 9
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'reCAPTCHA Verification'));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Public Key');
     $label->appendChild(Widget::Input('settings[recaptcha][public-key]', General::Sanitize($this->_Parent->Configuration->get('public-key', 'recaptcha'))));
     $div->appendChild($label);
     $label = Widget::Label('Private Key');
     $label->appendChild(Widget::Input('settings[recaptcha][private-key]', General::Sanitize($this->_Parent->Configuration->get('private-key', 'recaptcha'))));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a reCAPTCHA API public/private key pair from the <a href="http://recaptcha.net/whyrecaptcha.html">reCAPTCHA site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 10
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Interspire Email Marketer Filter'));
     $path = Widget::Label('XML Path');
     $path->appendChild(Widget::Input('settings[interspire][path]', General::Sanitize($this->get('path'))));
     $group->appendChild($path);
     $username = Widget::Label('Username');
     $username->appendChild(Widget::Input('settings[interspire][username]', General::Sanitize($this->get('username'))));
     $group->appendChild($username);
     $token = Widget::Label('User Token');
     $token->appendChild(Widget::Input('settings[interspire][token]', General::Sanitize($this->get('token'))));
     $group->appendChild($token);
     $context['wrapper']->appendChild($group);
 }
 public function appendPreferences($context)
 {
     $fieldset = new XMLElement('fieldset');
     $fieldset->setAttribute('class', 'settings');
     $context['wrapper']->appendChild($fieldset);
     $legend = new XMLElement('legend', __('Address Field'));
     $fieldset->appendChild($legend);
     $label = Widget::Label(__('Google Maps API Key'));
     $fieldset->appendChild($label);
     $key = General::Sanitize($context['parent']->Configuration->get('google-api-key', 'address-field'));
     $input = Widget::Input('settings[address-field][google-api-key]', $key);
     $label->appendChild($input);
     $text = __("You'll need to <a href=\"http://code.google.com/apis/maps/signup.html\">grab a Google Maps API key for <em>http://{$_SERVER['HTTP_HOST']}/</em></a> before you can geocode addresses.");
     $p = new XMLElement('p', $text, array('class' => 'help'));
     $fieldset->appendChild($p);
 }
Exemplo n.º 12
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'reCAPTCHA v.2.0 Verification'));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Public Key');
     $label->appendChild(Widget::Input('settings[recaptcha2][public-key]', General::Sanitize(Symphony::Configuration()->get('public-key', 'recaptcha2'))));
     $div->appendChild($label);
     $label = Widget::Label('Private Key');
     $label->appendChild(Widget::Input('settings[recaptcha2][private-key]', General::Sanitize(Symphony::Configuration()->get('private-key', 'recaptcha2'))));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a reCAPTCHA v.2.0 API public/private key pair from the <a href="https://www.google.com/recaptcha/">reCAPTCHA site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 13
0
 public function addCustomPreferenceFieldsets($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'New Visiter'));
     $message = Widget::Label('Message');
     $message->appendChild(Widget::Textarea('settings[newvisiter][message]', '5', '25', General::Sanitize($this->getMessage())));
     $group->appendChild($message);
     $thresholds = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
     $options = array();
     foreach ($thresholds as $t) {
         $options[] = array($t, $t == $this->_Parent->Configuration->get('threshold', 'newvisiter'), $t);
     }
     $threshold = Widget::Label('Threshold');
     $threshold->appendChild(Widget::Select('settings[newvisiter][threshold]', $options));
     $group->appendChild($threshold);
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 14
0
 public function addCustomPreferenceFieldsets($context)
 {
     $fieldset = new XMLElement('fieldset');
     $fieldset->setAttribute('class', 'settings');
     $fieldset->appendChild(new XMLElement('legend', 'Mailchimp'));
     $group = new XMLElement('div');
     $group->setAttribute('class', 'group');
     $api = Widget::Label('API Key');
     $api->appendChild(Widget::Input('settings[mailchimp][key]', General::Sanitize($this->getKey())));
     $api->appendChild(new XMLElement('p', Widget::Anchor(__('Generate your API Key'), 'http://kb.mailchimp.com/article/where-can-i-find-my-api-key'), array('class' => 'help')));
     $group->appendChild($api);
     $list = Widget::Label('Default List ID');
     $list->appendChild(Widget::Input('settings[mailchimp][list]', General::Sanitize($this->getList())));
     $list->appendChild(new XMLElement('p', __('Can be overidden from the frontend'), array('class' => 'help')));
     $group->appendChild($list);
     $fieldset->appendChild($group);
     $context['wrapper']->appendChild($fieldset);
 }
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Cloudinary Credentials')));
     $div = new XMLElement('div', NULL, array('class' => 'two columns'));
     $label = Widget::Label(__('API Key ID'));
     $label->setAttribute('class', 'column');
     $label->appendChild(Widget::Input('settings[cloudinary_upload_field][api-key]', General::Sanitize($this->getCloudinaryApiKey())));
     $div->appendChild($label);
     $label = Widget::Label('Secret Access Key');
     $label->setAttribute('class', 'column');
     $label->appendChild(Widget::Input('settings[cloudinary_upload_field][api-secret]', General::Sanitize($this->getCloudinarySecretKey()), 'password'));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a API Key and Secret Key from the <a href="http://cloudinary.com">Cloudinary Services site</a>.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 16
0
 public function __appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Sitemap'));
     $label = Widget::Label('Home page type');
     $label->appendChild(Widget::Input('settings[sitemap][index_type]', General::Sanitize(Symphony::Configuration()->get('index_type', 'sitemap'))));
     $group->appendChild($label);
     $label = Widget::Label('Primary page types (top level)');
     $label->appendChild(Widget::Input('settings[sitemap][primary_type]', General::Sanitize(Symphony::Configuration()->get('primary_type', 'sitemap'))));
     $group->appendChild($label);
     $label = Widget::Label('Utility page types (global navigation)');
     $label->appendChild(Widget::Input('settings[sitemap][utilities_type]', General::Sanitize(Symphony::Configuration()->get('utilities_type', 'sitemap'))));
     $group->appendChild($label);
     $label = Widget::Label('Excluded page types');
     $label->appendChild(Widget::Input('settings[sitemap][exclude_type]', General::Sanitize(Symphony::Configuration()->get('exclude_type', 'sitemap'))));
     $group->appendChild($label);
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 17
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Amazon S3 Security Credentials'));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Access Key ID');
     $label->appendChild(Widget::Input('settings[s3upload_field][access-key-id]', General::Sanitize($this->getAmazonS3AccessKeyId())));
     $div->appendChild($label);
     $label = Widget::Label('Secret Access Key');
     $label->appendChild(Widget::Input('settings[s3upload_field][secret-access-key]', General::Sanitize($this->getAmazonS3SecretAccessKey()), 'password'));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Get a Access Key ID and Secret Access Key from the <a href="http://aws.amazon.com">Amazon Web Services site</a>.', array('class' => 'help')));
     $label = Widget::Label('Default cache expiry time (in seconds)');
     $label->appendChild(Widget::Input('settings[s3upload_field][cache-control]', General::Sanitize($this->getCacheControl())));
     $group->appendChild($label);
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 18
0
 public function addCustomPreferenceFieldsets($context)
 {
     $fieldset = new XMLElement('fieldset');
     $fieldset->setAttribute('class', 'settings');
     $fieldset->appendChild(new XMLElement('legend', 'Mailchimp'));
     $group = new XMLElement('div');
     $group->setAttribute('class', 'group');
     $user = Widget::Label('Username');
     $user->appendChild(Widget::Input('settings[mailchimp][user]', General::Sanitize($this->getUser())));
     $group->appendChild($user);
     $pass = Widget::Label('Password');
     $pass->appendChild(Widget::Input('settings[mailchimp][pass]', General::Sanitize($this->getPass()), 'password'));
     $group->appendChild($pass);
     $fieldset->appendChild($group);
     $list = Widget::Label('List ID');
     $list->appendChild(Widget::Input('settings[mailchimp][list]', General::Sanitize($this->getList())));
     $fieldset->appendChild($list);
     $context['wrapper']->appendChild($fieldset);
 }
 public function appendPreferences($context)
 {
     $color = General::Sanitize(Symphony::Configuration()->get('headline_color', 'admin_rainbow_headline'));
     if ($color == "") {
         $color = "#";
     }
     $div = new XMLElement('div');
     $div->setAttribute('class', 'field field-colorchooser');
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Admin Rainbow Headline')));
     $label = Widget::Label(__('Headline Background Color'));
     // TODO: # per default anzeigen
     $label->appendChild(Widget::Input('settings[admin_rainbow_headline][headline_color]', $color));
     $label->setAttribute('class', 'color-chooser');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', __('This can be any RGB-Hex value, for example <code>#97712B</code>.'), array('class' => 'help')));
     $div->appendChild($group);
     $context['wrapper']->appendChild($div);
 }
Exemplo n.º 20
0
 public function appendPreferences($context)
 {
     $formatters = $this->getFormatters();
     $setttings = new XMLElement('fieldset');
     $setttings->setAttribute('class', 'settings');
     $setttings->appendChild(new XMLElement('legend', 'Textformatter Labels'));
     if (!empty($formatters) && is_array($formatters)) {
         foreach ($formatters as $handle => $about) {
             $group = new XMLElement('div');
             $group->setAttribute('class', 'group');
             $label = Widget::Label($about['name'] . ': Label Text (optional override)');
             $label->appendChild(Widget::Input('settings[textformatter_labels][' . $handle . '_text]', General::Sanitize($context['parent']->Configuration->get($handle . '_text', 'textformatter_labels'))));
             $group->appendChild($label);
             $label = Widget::Label($about['name'] . ': Link URL (optional)');
             $label->appendChild(Widget::Input('settings[textformatter_labels][' . $handle . '_url]', General::Sanitize($context['parent']->Configuration->get($handle . '_url', 'textformatter_labels'))));
             $group->appendChild($label);
             $setttings->appendChild($group);
         }
     }
     $context['wrapper']->appendChild($setttings);
 }
Exemplo n.º 21
0
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'File Manager'));
     $label = Widget::Label('Root Browse Location');
     $label->appendChild(Widget::Input('settings[filemanager][start-location]', General::Sanitize(Administration::instance()->Configuration->get('start-location', 'filemanager'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'This path is relative to the root Symphony installation folder, <code>' . DOCROOT . '</code>', array('class' => 'help')));
     $label = Widget::Label('Archive Name');
     $label->appendChild(Widget::Input('settings[filemanager][archive-name]', General::Sanitize(Administration::instance()->Configuration->get('archive-name', 'filemanager'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Default filename for archives generated by File Manager', array('class' => 'help')));
     $label = Widget::Label();
     $input = Widget::Input('settings[filemanager][show-hidden]', 'yes', 'checkbox');
     if (Administration::instance()->Configuration->get('show-hidden', 'filemanager') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Show Hidden Files and Folders');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Hidden files will not be included in archives unless this is checked.', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
Exemplo n.º 22
0
	/**
	* Parse the indexable content for an entry
	*
	* @param int $entry
	* @param int $section
	*/
	public function indexEntry($entry, $section) {
		self::assert();
		
		if (is_object($entry)) $entry = $entry->get('id');
		if (is_object($section)) $section = $section->get('id');
		
		// get a list of sections that have indexing enabled
		$indexed_sections = self::getIndexes();
		
		// go no further if this section isn't being indexed
		if (!isset($indexed_sections[$section])) return;

		// delete existing index for this entry
		self::deleteIndexByEntry($entry);
		
		// get the current section index config
		$section_index = $indexed_sections[$section];
		
		// modified from class.datasource.php
		// create filters and build SQL required for each
		if(is_array($section_index['filters']) && !empty($section_index['filters'])) {				
			
			foreach($section_index['filters'] as $field_id => $filter){

				if((is_array($filter) && empty($filter)) || trim($filter) == '') continue;

				if(!is_array($filter)){
					$filter_type = DataSource::__determineFilterType($filter);
					$value = preg_split('/'.($filter_type == DS_FILTER_AND ? '\+' : ',').'\s*/', $filter, -1, PREG_SPLIT_NO_EMPTY);			
					$value = array_map('trim', $value);
				} else {
					$value = $filter;
				}

				$field = self::$_entry_manager->fieldManager->fetch($field_id);
				$field->buildDSRetrivalSQL($value, $joins, $where, ($filter_type == DS_FILTER_AND ? TRUE : FALSE));

			}
		}			
		
		// run entry though filters
		$entry_prefilter = self::$_entry_manager->fetch($entry, $section, 1, 0, $where, $joins, FALSE, FALSE);
	
		// if no entry found, it didn't pass the pre-filtering
		if (empty($entry_prefilter)) return;
		
		// if entry passes filtering, pass entry_id as a DS filter to the EntryXMLDataSource DS
		$entry = reset($entry_prefilter);
		$entry = $entry['id'];
				
		// create a DS and filter on System ID of the current entry to build the entry's XML			
		$ds = new EntryXMLDataSource(Administration::instance(), NULL, FALSE);
		$ds->dsParamINCLUDEDELEMENTS = $indexed_sections[$section]['fields'];
		$ds->dsParamFILTERS['id'] = $entry;
		$ds->dsSource = (string)$section;
		
		// check if there are multilingual field in the indexes
		$section_multlingual = false;		
		foreach($indexed_sections[$section]['fields'] as $element_name) {
			$field_id = self::$_entry_manager->fieldManager->fetchFieldIDFromElementName($element_name);
			$type = self::$_entry_manager->fieldManager->fetchFieldTypeFromID($field_id);
			if ($type == 'multilingual') {
				$section_multlingual = true;
			}
		}

		if ($section_multlingual) {

			$supported_language_codes = explode(',', General::Sanitize(Symphony::Configuration()->get('languages', 'language_redirect')));
			$supported_language_codes = array_map('trim', $supported_language_codes);
			$supported_language_codes = array_filter($supported_language_codes);
	
			foreach ($supported_language_codes as $language) {				
				$param_pool = array();
				$ds->dsParamLANGUAGE = $language;
				
				$entry_xml = $ds->grab($param_pool);
				
				require_once(TOOLKIT . '/class.xsltprocess.php');
		
				// get text value of the entry
				$proc = new XsltProcess();
				$data = $proc->process($entry_xml->generate(), file_get_contents(EXTENSIONS . '/search_index/lib/parse-entry.xsl'));
				$data = trim($data);
				
				self::saveEntryIndex($entry, $section, $data, $language);
			}

		} else {

			$param_pool = array();
	
			$entry_xml = $ds->grab($param_pool);
			
			require_once(TOOLKIT . '/class.xsltprocess.php');
	
			// get text value of the entry
			$proc = new XsltProcess();
			$data = $proc->process($entry_xml->generate(), file_get_contents(EXTENSIONS . '/search_index/lib/parse-entry.xsl'));
			$data = trim($data);
			
			self::saveEntryIndex($entry, $section, $data);
		
		}
	}
Exemplo n.º 23
0
 public function append_preferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Shrimp'));
     $label = Widget::Label('URL Prefix');
     $label->appendChild(Widget::Input('settings[shrimp][prefix]', General::Sanitize($this->_get_url_prefix())));
     $group->appendChild($label);
     $context['wrapper']->appendChild($group);
 }
 public function appendPreferences($context)
 {
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Front End Authentication'));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Page Type');
     $label->appendChild(Widget::Input('settings[frontend-authentication][page-type]', General::Sanitize($context['parent']->Configuration->get('page-type', 'frontend-authentication'))));
     $div->appendChild($label);
     $pages = $this->_Parent->Database->fetch("SELECT `id`, `title` FROM `tbl_pages` ORDER BY `title` ASC");
     $label = Widget::Label('Login Page');
     $options = array();
     if (is_array($pages) && !empty($pages)) {
         foreach ($pages as $page) {
             $path = '/' . $this->_Parent->resolvePagePath($page['id']);
             $options[] = array($path, $context['parent']->Configuration->get('login-page', 'frontend-authentication') == $path, $path);
         }
     }
     $label->appendChild(Widget::Select('settings[frontend-authentication][login-page]', $options));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Any page with this type will check for a valid cookie, otherwise be thrown to a login screen', array('class' => 'help')));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $fields = $this->_Parent->Database->fetch("SELECT t1.*, t2.name as `section` FROM `tbl_fields` AS `t1` \n\t\t\t\t\t\t\t\t\t\t\t\t\t  LEFT JOIN `tbl_sections` AS `t2` ON `t1`.parent_section = t2.id \n\t\t\t\t\t\t\t\t\t\t\t\t\t  WHERE `t1`.type NOT IN ('checkbox', 'select', 'sectionlink', 'date', 'textarea', 'upload', 'author')\n\t\t\t\t\t\t\t\t\t\t\t\t\t  ORDER BY t1.`parent_section` ASC, t1.`element_name` ASC");
     $label = Widget::Label('Username Field');
     $options = array();
     if (is_array($fields) && !empty($fields)) {
         foreach ($fields as $field) {
             $options[] = array($field['id'], $context['parent']->Configuration->get('username-field', 'frontend-authentication') == $field['id'], $field['section'] . ' > ' . $field['label']);
         }
     }
     $label->appendChild(Widget::Select('settings[frontend-authentication][username-field]', $options));
     $div->appendChild($label);
     $label = Widget::Label('Password Field');
     $options = array();
     if (is_array($fields) && !empty($fields)) {
         foreach ($fields as $field) {
             $options[] = array($field['id'], $context['parent']->Configuration->get('password-field', 'frontend-authentication') == $field['id'], $field['section'] . ' > ' . $field['label']);
         }
     }
     $label->appendChild(Widget::Select('settings[frontend-authentication][password-field]', $options));
     $div->appendChild($label);
     $group->appendChild($div);
     $group->appendChild(new XMLElement('p', 'Both fields must be from the same section', array('class' => 'help')));
     $label = Widget::Label();
     $input = Widget::Input('settings[frontend-authentication][use-sessions]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('use-sessions', 'frontend-authentication') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Use sessions instead of cookies');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Sessions expire when the browser is closed. They are stored on the server are considered more secure than cookies.', array('class' => 'help')));
     $label = Widget::Label('Password Retrieval Email Subject');
     $label->appendChild(Widget::Input('settings[frontend-authentication][email-subject]', stripslashes($context['parent']->Configuration->get('email-subject', 'frontend-authentication'))));
     $group->appendChild($label);
     $label = Widget::Label('Password Retrieval Email Body');
     $label->appendChild(Widget::Textarea('settings[frontend-authentication][email-body]', 10, 50, stripslashes($context['parent']->Configuration->get('email-body', 'frontend-authentication'))));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Use <code>{$password}</code> and <code>{$username}</code> for dynamic values. Any parameters in the XSLT can also be used. E.G. <code>{$root}</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
 /**
  * Add a new preferences field for the name of the section where form valiation rulesets are stored.
  *
  * @param array $context
  * @return void
  */
 public function appendPreferences($context)
 {
     // Initialize the group.
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'Form Validation'));
     // Add the field for the section name.
     $label = Widget::Label('Section Name');
     $label->appendChild(Widget::Input('settings[formvalidation][section]', General::Sanitize($this->getSection())));
     $group->appendChild($label);
     // Add the field for the field name.
     $label = Widget::Label('Field Name');
     $label->appendChild(Widget::Input('settings[formvalidation][field]', General::Sanitize($this->getField())));
     $group->appendChild($label);
     // Append everything to the wrapper.
     $context['wrapper']->appendChild($group);
 }
 public function appendPreferences($context)
 {
     $conf = Symphony::Configuration();
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Mobile Device Detection')));
     // No Redirect Cookie:
     $label = Widget::Label(__('No Redirect Cookie'));
     $label->appendChild(Widget::Input('settings[' . self::CONF . '][' . self::CONF_COOKIE . ']', General::Sanitize($conf->get(self::CONF_COOKIE, self::CONF))));
     $group->appendChild($label);
     // Redirect URL:
     $label = Widget::Label(__('Redirect URL'));
     $label->appendChild(Widget::Input('settings[' . self::CONF . '][' . self::CONF_URL . ']', General::Sanitize($conf->get(self::CONF_URL, self::CONF))));
     $group->appendChild($label);
     // Redirect Devices:
     $label = Widget::Label(__('Redirect Devices'));
     $label->appendChild(Widget::Input('settings[' . self::CONF . '][' . self::CONF_DEVICES . ']', General::Sanitize($conf->get(self::CONF_DEVICES, self::CONF))));
     $group->appendChild($label);
     $list = new XMLElement('ul');
     $list->setAttribute('class', 'tags');
     foreach (MobileDetector::devices() as $type => $device) {
         $item = new XMLElement('li', $type);
         $list->appendChild($item);
         $list->setAttribute('data-interactive', 'data-interactive');
     }
     $group->appendChild($list);
     $context['wrapper']->appendChild($group);
 }