/**
  * 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;
 }
 /**
  * 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);
 }
 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);
 }
Example #4
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;
 }
 /**
  * Settings Form
  *
  * @param array  $current  Current extension settings (not site-specific)
  * @see   http://expressionengine.com/docs/development/extensions.html#settings
  */
 function settings_form()
 {
     global $DB, $DSP, $LANG, $IN, $SD;
     // Breadcrumbs
     $DSP->crumbline = TRUE;
     $DSP->title = $LANG->line('extension_settings');
     $DSP->crumb = $DSP->anchor(BASE . AMP . 'C=admin' . AMP . 'area=utilities', $LANG->line('utilities')) . $DSP->crumb_item($DSP->anchor(BASE . AMP . 'C=admin' . AMP . 'M=utilities' . AMP . 'P=extensions_manager', $LANG->line('extensions_manager'))) . $DSP->crumb_item(FF_NAME);
     $DSP->right_crumb($LANG->line('disable_extension'), BASE . AMP . 'C=admin' . AMP . 'M=utilities' . AMP . 'P=toggle_extension_confirm' . AMP . 'which=disable' . AMP . 'name=' . $IN->GBL('name'));
     // Donations button
     $DSP->body .= '<div class="donations">' . '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2181794" target="_blank">' . $LANG->line('donate') . '</a>' . '</div>';
     // open form
     $DSP->body .= '<h1>' . FF_NAME . ' <small>' . FF_VERSION . '</small></h1>' . $DSP->form_open(array('action' => 'C=admin' . AMP . 'M=utilities' . AMP . 'P=save_extension_settings', 'name' => 'settings_subtext', 'id' => 'ffsettings'), array('name' => strtolower(FF_CLASS)));
     // initialize Fieldframe_SettingsDisplay
     $SD = new Fieldframe_SettingsDisplay();
     // import lang files
     $LANG->fetch_language_file('publish_ad');
     // fieldtypes folder
     $DSP->body .= $SD->block('fieldtypes_folder_title') . $SD->info_row('fieldtypes_folder_info') . $SD->row(array($SD->label('fieldtypes_url_label', 'fieldtypes_url_subtext'), $SD->text('fieldtypes_url', $this->settings['fieldtypes_url']))) . $SD->row(array($SD->label('fieldtypes_path_label', 'fieldtypes_path_subtext'), $SD->text('fieldtypes_path', $this->settings['fieldtypes_path']))) . $SD->block_c();
     // Check for Updates
     $lgau_query = $DB->query("SELECT class FROM exp_extensions\n\t\t                            WHERE class = 'Lg_addon_updater_ext' AND enabled = 'y' LIMIT 1");
     $lgau_enabled = $lgau_query->num_rows ? TRUE : FALSE;
     $DSP->body .= $SD->block('check_for_updates_title') . $SD->info_row('check_for_updates_info') . $SD->row(array($SD->label('check_for_updates_label', 'check_for_updates_subtext'), $SD->radio_group('check_for_updates', $this->settings['check_for_updates'] != 'n' ? 'y' : 'n', array('y' => 'yes', 'n' => 'no')))) . $SD->block_c();
     // Fieldtypes Manager
     $this->fieldtypes_manager(FALSE, $SD);
     // Close form
     $DSP->body .= $DSP->qdiv('itemWrapperTop', $DSP->input_submit()) . $DSP->form_c();
     // CSS
     $css = '<style type="text/css" charset="utf-8">' . NL . '  .donations { float:right; }' . NL . '  .donations a { display:block; margin:-2px 10px 0 0; padding:5px 0 5px 67px; width:193px; height:15px; font-size:12px; line-height:15px;' . ' background:url(http://brandon-kelly.com/images/shared/donations.png) no-repeat 0 0; color:#000; font-weight:bold; }' . NL . '  h1 { padding:7px 0; }' . NL . '</style>';
     $this->snippets['head'][] = $css;
 }