Ejemplo n.º 1
0
		public function appendPreferences($context){
			// Import the db_sync.sql file when the cdi_import action is called
			// The import action is the only left to require a post-back because AJAX file upload is cumbersome
			if(isset($_POST["action"]["cdi_import"])) {
				CdiDBSync::import();
			} else if(isset($_POST["action"]["dumpdb_restore"])) {
				CdiDumpDB::restore();
			}
			
			// Create the Preferences user-interface for the CDI extension
			$group = new XMLElement('fieldset');
			$group->setAttribute('class', 'cdi settings');
			$group->appendChild(new XMLElement('legend', 'Continuous Database Integration'));
			$group->appendChild(new XMLElement('div', '<span class="image">&#160;</span><span>Processing... please wait.</span>', array('class' => 'help cdiLoading cdiHidden')));
			Administration::instance()->Page->Form->setAttribute('enctype', 'multipart/form-data');
			
			$group->appendChild(CdiPreferences::appendCdiMode());
			if(CdiUtil::isCdi()) {
				$group->appendChild(CdiPreferences::appendCdiPreferences());
			} else if(CdiUtil::isCdiDBSync()) {
				$group->appendChild(CdiPreferences::appendDBSyncPreferences());
			}

			// Append preferences
			$context['wrapper']->appendChild($group);
		}
Ejemplo n.º 2
0
		public static function appendClearLog() {
			$div = new XMLElement('div',NULL,array('class' => 'cdiClear'));
			$div->appendChild(new XMLElement('h3','Clear Log Entries',array('style' => 'margin-bottom: 5px;')));
			$button = new XMLElement('div',NULL,array('style' => 'margin: 10px 0;'));
			$button->appendChild(new XMLElement('input', null, array('value' => 'Clear', 'name' => 'action[cdi_clear]', 'type' => 'button', 'class' => 'cdi_clear_action')));
			if(CdiUtil::isCdi()) {
				$button->appendChild(new XMLElement('span','&nbsp;Press "Clear" to remove all CDI log entries from disk and/or Symphony Database'));
				$div->appendChild($button);
				$div->appendChild(new XMLElement('p', 'You can use the "Clear" button to clean up old CDI logs. 
														 Ensure that all your Symphony have been updated either by CDI (check the last executed queries list above) or by manually restoring the same database backup on all instances.
														 Make sure that you clear the log files on every instance (including the "Master" instance). It is important that the database schemas are synchronized before starting with a clean sheet.', array('class' => 'help')));
			} else {
				$button->appendChild(new XMLElement('span','&nbsp;Press "Clear" to remove <em>' . CDI_DB_SYNC_FILENAME . '</em> from disk'));
				$div->appendChild($button);
				$div->appendChild(new XMLElement('p', 'You can use the "Clear" button to remove current <em>' . CDI_DB_SYNC_FILENAME . '</em> file. 
													   Ensure that all your Symphony have been updated either by CDI or by manually restoring the same database backup on all instances.
													   Make sure that you clear the <em>' . CDI_DB_SYNC_FILENAME . '</em> files on every instance (including the "Master" instance). It is important that the database schemas are synchronized before starting with a clean sheet.', array('class' => 'help')));
			}
			return $div;
		}