Ejemplo n.º 1
0
    /**
     * Display Site Settings
     */
    function display_site_settings()
    {
        global $DB, $DSP;
        $fields_q = $DB->query('SELECT f.field_id, f.field_label, g.group_name
		                          FROM exp_weblog_fields AS f, exp_field_groups AS g
		                          WHERE f.field_type = "data_matrix"
		                            AND f.group_id = g.group_id
		                          ORDER BY g.group_name, f.field_order, f.field_label');
        if ($fields_q->num_rows) {
            $SD = new Fieldframe_SettingsDisplay();
            $r = $SD->block();
            $convert_r = '';
            $last_group_name = '';
            foreach ($fields_q->result as $row) {
                if ($row['group_name'] != $last_group_name) {
                    $convert_r .= $DSP->qdiv('defaultBold', $row['group_name']);
                    $last_group_name = $row['group_name'];
                }
                $convert_r .= '<label>' . $DSP->input_checkbox('convert[]', $row['field_id']) . $row['field_label'] . '</label>' . '<br>';
            }
            $r .= $SD->row(array($SD->label('convert_label', 'convert_desc'), $convert_r));
            $r .= $SD->block_c();
            return $r;
        }
        return FALSE;
    }
Ejemplo n.º 2
0
 /**
  * Display Field
  * 
  * @param  string  $field_name      The field's name
  * @param  mixed   $field_data      The field's current value
  * @param  array   $field_settings  The field's settings
  * @return string  The field's HTML
  */
 function display_field($field_name, $field_data, $field_settings)
 {
     global $DSP;
     $this->prep_field_data($field_data);
     $SD = new Fieldframe_SettingsDisplay();
     $r = $DSP->input_hidden($field_name, 'n') . $SD->multiselect($field_name . '[]', $field_data, $field_settings['options'], array('width' => ';'));
     return $r;
 }
 /**
  * Display Site Settings
  */
 function display_site_settings()
 {
     global $DB, $PREFS, $DSP;
     $SD = new Fieldframe_SettingsDisplay();
     $r = $SD->block() . $SD->row(array($SD->label('quality_setting_label', 'quality_setting_desc'), $SD->select('quality_setting', $this->site_settings['quality_setting'], array('y' => 'yes', 'n' => 'no')))) . $SD->row(array($SD->label('thumbs_setting_label', 'thumbs_setting_desc'), $SD->select('thumbs_setting', $this->site_settings['thumbs_setting'], array('y' => 'yes', 'n' => 'no')))) . $SD->block_c();
     return $r;
 }
 function display_field_settings($field_settings)
 {
     global $FFSD;
     // initialize Fieldframe_SettingsDisplay
     if (!isset($FFSD)) {
         $FFSD = new Fieldframe_SettingsDisplay();
     }
     $markitup_set = isset($field_settings['markitup_set']) ? $field_settings['markitup_set'] : '';
     $cell2_output = $FFSD->label('Markitup Set', 'leave blank to use the site\'s default markitup set');
     $cell2_output .= $FFSD->text('markitup_set', $markitup_set);
     return array('formatting_available' => true, 'cell2' => $cell2_output);
 }
 /**
  * Display Cell Settings
  * 
  * @param  array  $cell_settings  The cell's settings
  * @return string  Settings HTML
  */
 function display_cell_settings($cell_settings)
 {
     $SD = new Fieldframe_SettingsDisplay();
     $settings = '<div style="margin-bottom: 10px;">';
     $settings .= $SD->label('Region type');
     $settings .= $SD->select('type', $cell_settings['type'], $this->types);
     $settings .= '</div>';
     $settings .= '<div style="margin-bottom: 10px;">';
     $settings .= $SD->label('Value to display');
     $settings .= $SD->select('value', $cell_settings['value'], $this->values);
     $settings .= '</div>';
     return $settings;
 }
Ejemplo n.º 6
0
 /**
  * Display Cell Settings
  * 
  * @param  array  $cell_settings  The cell's settings
  * @return array  Settings HTML (cell1, cell2, rows)
  */
 function display_cell_settings($cell_settings)
 {
     global $DSP, $LANG;
     $LANG->fetch_language_file('ff_vz_upload');
     // Initialize a new instance of SettingsDisplay
     $SD = new Fieldframe_SettingsDisplay();
     $out = '';
     // Get the file upload destinations
     $dests = $this->_get_upload_dests();
     if ($dests) {
         // If there are any upload destinations, put them in a select box...
         $upload_dest = isset($cell_settings['vz_upload_dest']) ? $cell_settings['vz_upload_dest'] : key($dests);
         $out .= '<label class="itemWrapper">' . $DSP->qdiv('defaultBold', $LANG->line('settings_destination')) . $SD->select('vz_upload_dest', $upload_dest, $dests) . '</label>';
     } else {
         $out .= '<p class="highlight">' . $LANG->line('no_destinations_found') . '</p>';
     }
     // Which file types are allowed?
     $types = isset($cell_settings['vz_upload_types']) ? $cell_settings['vz_upload_types'] : '*.jpg;*.jpeg;*.png;*.gif';
     $out .= '<label class="itemWrapper">' . $DSP->qdiv('defaultBold', $LANG->line('settings_types')) . $SD->text('vz_upload_types', $types) . '</label>';
     // Return the settings block
     return $out;
 }
 /**
  * Display Field
  * 
  * @param  string  $field_name      The field's name
  * @param  mixed   $field_data      The field's current value
  * @param  array   $field_settings  The field's settings
  * @return string  The field's HTML
  */
 function display_field($field_name, $field_data, $field_settings)
 {
     $this->prep_field_data($field_data);
     $SD = new Fieldframe_SettingsDisplay();
     return $SD->radio_group($field_name, $field_data, $field_settings['options']);
 }
Ejemplo n.º 8
0
 /**
  * Display Field
  * 
  * @param  string  $field_name      The field's name
  * @param  mixed   $field_data      The field's current value
  * @param  array   $field_settings  The field's settings
  * @return string  The field's HTML
  */
 function display_field($field_name, $field_data, $field_settings)
 {
     global $DSP;
     $this->prep_field_data($field_data);
     $SD = new Fieldframe_SettingsDisplay();
     return $SD->select($field_name, $field_data, $field_settings['options']);
 }
 /**
  * Display Cell
  * 
  * @param  string  $cell_name      The cell's name
  * @param  mixed   $cell_data      The cell's current value
  * @param  array   $cell_settings  The cell's settings
  * @return string  The cell's HTML
  */
 function display_cell($cell_name, $cell_data, $cell_settings)
 {
     $SD = new Fieldframe_SettingsDisplay();
     return $SD->multiselect($cell_name . '[]', $cell_data, $cell_settings['options'], array('width' => '145px'));
 }
 /**
  * Display Site Settings
  */
 function display_site_settings()
 {
     global $DB, $PREFS, $DSP;
     $SD = new Fieldframe_SettingsDisplay();
     $r = $SD->block() . $SD->row(array($SD->label('api_url_label', 'api_url_desc'), $SD->text('api_url', $this->site_settings['api_url']))) . $SD->row(array($SD->label('username_label', 'username_desc'), $SD->text('username', $this->site_settings['username']))) . $SD->row(array($SD->label('password_label', 'password_desc'), $SD->text('password', $this->site_settings['password']))) . $SD->block_c();
     return $r;
 }
 /**
  * Fieldtypes Manager
  */
 function fieldtypes_manager($standalone = TRUE, $SD = NULL)
 {
     global $DB, $DSP, $LANG, $IN, $PREFS, $SD;
     if (!$SD) {
         // initialize Fieldframe_SettingsDisplay
         $SD = new Fieldframe_SettingsDisplay();
     }
     if ($standalone) {
         // save submitted settings
         if ($this->save_fieldtypes_manager()) {
             $DSP->body .= $DSP->qdiv('box', $DSP->qdiv('success', $LANG->line('settings_update')));
         }
         // load language file
         $LANG->fetch_language_file('fieldframe');
         // Breadcrumbs
         $DSP->crumbline = TRUE;
         $DSP->title = $LANG->line('fieldtypes_manager');
         $DSP->crumb = $DSP->anchor(BASE . AMP . 'C=admin' . AMP . 'area=utilities', $LANG->line('utilities')) . $DSP->crumb_item($LANG->line('fieldtypes_manager'));
         // open form
         $DSP->body .= $DSP->form_open(array('action' => 'C=admin' . AMP . 'M=utilities' . AMP . 'P=fieldtypes_manager', 'name' => 'settings_subtext', 'id' => 'ffsettings'), array('name' => strtolower(FF_CLASS)));
     }
     // fieldtype settings
     $DSP->body .= $SD->block('fieldtypes_manager', 5);
     // initialize fieldtypes
     if ($ftypes = $this->_get_all_installed_ftypes()) {
         // add the headers
         $DSP->body .= $SD->heading_row(array($LANG->line('fieldtype'), $LANG->line('fieldtype_enabled'), $LANG->line('settings'), $LANG->line('documentation')));
         $row_ids = array();
         foreach ($ftypes as $class_name => $ftype) {
             $row_id = 'ft_' . $ftype->_class_name;
             $row_ids[] = '"' . $row_id . '"';
             if (method_exists($ftype, 'display_site_settings')) {
                 if (!$ftype->info['no_lang']) {
                     $LANG->fetch_language_file($class_name);
                 }
                 $site_settings = $ftype->display_site_settings();
             } else {
                 $site_settings = FALSE;
             }
             $DSP->body .= $SD->row(array($SD->label($ftype->info['name'] . NBS . $DSP->qspan('xhtmlWrapperLight defaultSmall', $ftype->info['version']), $ftype->info['desc']), $ftype->_requires ? '--' : $SD->radio_group('ftypes[' . $class_name . '][enabled]', $ftype->_is_enabled ? 'y' : 'n', array('y' => 'yes', 'n' => 'no')), $site_settings ? '<a class="toggle show" id="' . $row_id . '_show"><img src="' . $PREFS->ini('theme_folder_url', 1) . 'cp_global_images/expand.gif" border="0">  ' . $LANG->line('show') . '</a>' . '<a class="toggle hide" id="' . $row_id . '_hide"><img src="' . $PREFS->ini('theme_folder_url', 1) . 'cp_global_images/collapse.gif" border="0">  ' . $LANG->line('hide') . '</a>' : '--', $ftype->info['docs_url'] ? '<a href="' . stripslashes($ftype->info['docs_url']) . '">' . $LANG->line('documentation') . '</a>' : '--'), NULL, array('id' => $row_id));
             if ($ftype->_requires) {
                 $data = '<p>' . $ftype->info['name'] . ' ' . $LANG->line('requires') . ':</p>' . '<ul>';
                 foreach ($ftype->_requires as $dependency => $version) {
                     $data .= '<li class="default">' . $dependency . ' ' . $version . ' ' . $LANG->line('or_later') . '</li>';
                 }
                 $data .= '</ul>';
                 $DSP->body .= $SD->row(array('', $data), $SD->row_class);
             } else {
                 if ($site_settings) {
                     $data = '<div class="ftsettings">' . $this->_group_ftype_inputs($ftype->_class_name, $site_settings) . $DSP->div_c();
                     $DSP->body .= $SD->row(array($data), '', array('id' => $row_id . '_settings', 'style' => 'display:none;'));
                 }
             }
         }
         $js = '<script type="text/javascript" charset="utf-8">' . NL . '  function ffEnable(ft) {' . NL . '    ft.show.className = "toggle show";' . NL . '    ft.show.onclick = function() {' . NL . '      ft.show.style.display = "none";' . NL . '      ft.hide.style.display = "block";' . NL . '      ft.settings.style.display = "table-row";' . NL . '    };' . NL . '    ft.hide.onclick = function() {' . NL . '      ft.show.style.display = "block";' . NL . '      ft.hide.style.display = "none";' . NL . '      ft.settings.style.display = "none";' . NL . '    };' . NL . '  }' . NL . '  function ffDisable(ft) {' . NL . '    ft.show.className = "toggle show disabled";' . NL . '    ft.show.onclick = null;' . NL . '    ft.show.style.display = "block";' . NL . '    ft.hide.style.display = "none";' . NL . '    ft.settings.style.display = "none";' . NL . '  }' . NL . '  function ffInitRow(rowId) {' . NL . '    var ft = {' . NL . '      tr: document.getElementById(rowId),' . NL . '      show: document.getElementById(rowId+"_show"),' . NL . '      hide: document.getElementById(rowId+"_hide"),' . NL . '      settings: document.getElementById(rowId+"_settings")' . NL . '    };' . NL . '    if (ft.settings) {' . NL . '      ft.toggles = ft.tr.getElementsByTagName("input");' . NL . '      ft.toggles[0].onchange = function() { ffEnable(ft); };' . NL . '      ft.toggles[1].onchange = function() { ffDisable(ft); };' . NL . '      if (ft.toggles[0].checked) ffEnable(ft);' . NL . '      else ffDisable(ft);' . NL . '    }' . NL . '  }' . NL . '  var ffRowIds = [' . implode(',', $row_ids) . '];' . NL . '  for (var i = 0; i < ffRowIds.length; i++) {' . NL . '    ffInitRow(ffRowIds[i]);' . NL . '  }' . NL . '</script>';
         $this->snippets['body'][] = $js;
     } else {
         if (!defined('FT_PATH')) {
             $DSP->body .= $SD->info_row('no_fieldtypes_path');
         } else {
             if (in_array('bad_ft_path', $this->errors)) {
                 $DSP->body .= $SD->info_row('bad_fieldtypes_path');
             } else {
                 $DSP->body .= $SD->info_row('no_fieldtypes');
             }
         }
     }
     $DSP->body .= $SD->block_c();
     if ($standalone) {
         // Close form
         $DSP->body .= $DSP->qdiv('itemWrapperTop', $DSP->input_submit($LANG->line('apply'))) . $DSP->form_c();
     }
     // CSS
     $css = '<style type="text/css" charset="utf-8">' . NL . '  #ffsettings a.toggle { display:block; cursor:pointer; }' . NL . '  #ffsettings a.toggle.hide { display:none; }' . NL . '  #ffsettings a.toggle.disabled { color:#000; opacity:0.4; cursor:default; }' . '  #ffsettings .ftsettings { margin:-3px -1px -1px; }' . '  #ffsettings .ftsettings, #ffsettings .ftsettings * { background:#262e33; color:#999; }' . NL . '  #ffsettings .ftsettings input.input, #ffsettings .ftsettings textarea { background:#fff; color:#333; }' . NL . '  #ffsettings .ftsettings table { border:none; }' . NL . '  #ffsettings .ftsettings table tr td { border-top:1px solid #1d2326; padding-left:8px; padding-right:8px;  }' . '  #ffsettings .ftsettings table tr td.tableHeading { color:#ddd; background:#232a2e; }' . NL . '  #ffsettings .ftsettings .defaultBold { color:#ccc; }' . NL . '  #ffsettings .ftsettings .box { border-color:transparent; }' . NL . '  #ffsettings .ftsettings .tableCellOne, #ffsettings .ftsettings .tableCellOneBold, #ffsettings .ftsettings .tableCellTwo, #ffsettings .ftsettings .tableCellTwoBold { border-bottom:none; }' . NL . '</style>';
     $this->snippets['head'][] = $css;
 }
 function display_cell($cell_name, $cell_data, $cell_settings)
 {
     $SD = new Fieldframe_SettingsDisplay();
     return $SD->select($cell_name, $cell_data, $cell_settings['options']);
 }
Ejemplo n.º 13
0
 /**
  * Display Field
  */
 function display_field($field_name, $data, $settings, $cell = FALSE)
 {
     $this->_include_theme_css('styles/pt_pill.css');
     $this->_include_theme_js('scripts/pt_pill.js');
     $field_id = str_replace(array('[', ']'), array('_', ''), $field_name);
     // -------------------------------------------
     //  Insert the JS
     // -------------------------------------------
     if (!$cell) {
         $this->insert_js('new ptPill(jQuery("#' . $field_id . '"));');
     }
     // default?
     if (!$data && isset($settings['default'])) {
         $data = $settings['default'];
     }
     $SD = new Fieldframe_SettingsDisplay();
     return '<select id="' . $field_id . '" name="' . $field_name . '">' . $SD->_select_options($data, $settings['options']) . '</select>';
 }
Ejemplo n.º 14
0
	/**
	 * Display Field Settings
	 */
	function display_field_settings($settings)
	{
		global $FF;

		// create a new SettingsDisplay instance
		$SD = new Fieldframe_SettingsDisplay();

		// open the settings table
		$r = $SD->block();
		$SD->row_count++;

		$rows = $this->field_settings($settings);

		// -------------------------------------------
		//  Field Conversion
		// -------------------------------------------

		// was this previously a different fieldtype?
		if (isset($FF->data) && $FF->data['field_id'] && $FF->data['field_type'] != 'ftype_id_'.$this->_fieldtype_id)
		{
			array_unshift($rows, array(
				$SD->label('wygwam_convert_label', 'wygwam_convert_desc'),
				$SD->select('convert',
					(in_array($FF->data['field_fmt'], array('br', 'xhtml')) ? 'auto' : ''),
					array(
						''        => '--',
						'auto'    => 'Auto &lt;br /&gt; or XHTML',
						'textile' => 'Textile'
					)
				)
			));
		}

		// add the rows
		foreach ($rows as $row)
		{
			$r .= $SD->row($row);
		}

		// close the table
		$r .= $SD->block_c();

		return array('rows' => array(array(
			'<div id="ft_wygwam" style="margin: -7px -11px -7px -7px; font-size: 12px;">'.$r.'</div>'
		)));
	}
Ejemplo n.º 15
0
 /**
  * Display Field
  */
 function display_field($field_name, $data, $settings, $cell = FALSE)
 {
     global $FF, $IN;
     $this->_include_theme_css('styles/pt_switch.css');
     $this->_include_theme_js('scripts/pt_switch.js');
     $field_id = str_replace(array('[', ']'), array('_', ''), $field_name);
     if ($cell) {
         $new = !(isset($FF->row['entry_id']) ? $FF->row['entry_id'] : $IN->GBL('entry_id')) || $field_name == '{DEFAULT}';
     } else {
         $new = !(isset($FF->row['entry_id']) ? $FF->row['entry_id'] : $IN->GBL('entry_id'));
         $this->insert_js('new ptSwitch(jQuery("#' . $field_id . '"));');
     }
     // Pretend it's a new entry if $data isn't set to one of the values
     if ($data != $settings['off_val'] && $data != $settings['on_val']) {
         $new = TRUE;
     }
     $options = array($settings['off_val'] => $settings['off_label'], $settings['on_val'] => $settings['on_label']);
     if ($new) {
         $data = $settings[$settings['default'] . '_val'];
     }
     $SD = new Fieldframe_SettingsDisplay();
     return '<select id="' . $field_id . '" name="' . $field_name . '">' . $SD->_select_options($data, $options) . '</select>';
 }
 /**
  * Display Field
  * 
  * @param  string  $field_name      The field's name
  * @param  mixed   $field_data      The field's current value
  * @param  array   $field_settings  The field's settings
  * @return string  The field's HTML
  */
 function display_field($field_name, $field_data, $field_settings)
 {
     $this->prep_field_data($field_data);
     $SD = new Fieldframe_SettingsDisplay();
     return $SD->multiselect($field_name . '[]', $field_data, $field_settings['options'], array('width' => ';'));
 }
 /**
  * Display Field Settings
  *
  * @param  array  $field_settings  The field's settings
  * @return array  Settings HTML (cell1, cell2, rows)
  */
 function display_field_settings($field_settings)
 {
     global $DSP, $LANG;
     $SD = new Fieldframe_SettingsDisplay();
     // $r = $SD->block('Hotspotter Settings');
     $r = '<table>';
     $r .= $SD->row(array($DSP->qdiv('defaultBold', 'Select Your File Field'), $SD->select('file_field', $field_settings['file_field'], $this->_get_fields())));
     $r .= $SD->row(array($DSP->qdiv('defaultBold', 'Select Your Matrix Field'), $SD->select('matrix_field', $field_settings['matrix_field'], $this->_get_fields())));
     $r .= $SD->row(array($SD->label('Initial Height'), $SD->text('initial_height', $field_settings['initial_height'])));
     $r .= $SD->row(array($SD->label('Initial Width'), $SD->text('initial_width', $field_settings['initial_width'])));
     $r .= $SD->row(array($SD->label('Should Hotspots be Resizable?'), $SD->radio_group('resizable', $field_settings['resizable'], array('yes' => 'yes', 'no' => 'no'))));
     $r .= '</table>';
     // $r .= $SD->block_c();
     return array('cell2' => $r);
     // return array('cell2' => $cell2);
 }