cchost
[ class tree: cchost ] [ index: cchost ] [ all elements ]

Class: CCEditConfigForm

Source Location: /cclib/cc-admin.php

Class Overview

CCForm
   |
   --CCEditConfigForm

Derive from this class to let the user modify the app's config


Variables

Methods


Child classes:

CCDisableSiteForm
Derive from this class to let the user modify the app's config
CCAdminThrottleForm
Form for configuring upload rules
CCMailAdminForm
Derive from this class to let the user modify the app's config
CCDownloadAdminForm
Derive from this class to let the user modify the app's config
CCAdminBlogPingForm
Form for configuration the file format verification module
CCPathAdminForm
Derive from this class to let the user modify the app's config
CCAdminPlaylistsForm
Derive from this class to let the user modify the app's config
CCBanAdminForm
Derive from this class to let the user modify the app's config
CCAdminRenameForm
Admin form for upload renaming rules
CCAdminRatingsForm
Form for admin ui for ratings
CCAdminTaggerForm
Admin form for upload ID3 tagging rules
CCAdminConfigForm
Displays global configuration options.
CCAdminSettingsForm
Displays local configuration options.
CCAdminSuperForm
CCAdminTemplateMacrosForm
CCAdminTemplateTagsForm
CCAdminFileVerifyForm
Form for configuration the file format verification module

Inherited Methods

Class: CCForm

CCForm::CCForm()
Constructor
CCForm::AddFormField()
Set (or replace) a field's meta-data structure.
CCForm::AddFormFields()
Add meta-data for HTML form fields
CCForm::AddTemplateVars()
Set (or replace) a a group of template fields to be passed to the template generator
CCForm::CallFormMacro()
Sets up for custom macros to be called when generating the form
CCForm::FormFieldExists()
Checks the existance of a field in the form
CCForm::GenerateForm()
Prepares form variables for display.
CCForm::GenerateHTML()
Generate HTML from this form.
CCForm::generator_checkbox()
Handles generation of HMTL field <input type='checkbox'
CCForm::generator_date()
Handles generation a bunch of &lt;select HTML fields that represents a date/time
CCForm::generator_email()
Handles generation of &lt;input type='text' HTML field
CCForm::generator_localdir()
Handles generation of HTML field
CCForm::generator_metalmacro()
CCForm::generator_passthru()
Handles generation of HTML field (passes 'value' as straight html)
CCForm::generator_password()
Handles generation of &lt;input type='password' HTML field
CCForm::generator_pattern()
Validates the user against a regex pattern
CCForm::generator_radio()
Handles generation of several &lt;input type='radio' HTML field
CCForm::generator_regex()
Accepts a regular expression as input and compiles to verify it
CCForm::generator_select()
Handles generation &lt;select and several &lt;option HTML field
CCForm::generator_statictext()
Handles generation of HTML field &lt;span
CCForm::generator_tagsedit()
Handles generation of &lt;input type='text' HTML field
CCForm::generator_textarea()
Handles generation of HTML field &lt;textarea
CCForm::generator_textedit()
Handles generation of HMTL field INPUT type='text'
CCForm::GetFieldError()
Returns the error the validator set on this field
CCForm::GetFormFieldItem()
Retrieves a specific element from the field's meta-data structure.
CCForm::GetFormID()
Retrieves the value that will be put into the HTML forms 'id' attribute
CCForm::GetFormValue()
Get the current value in a form field.
CCForm::GetFormValues()
Returns an array of all the fields in the table.
CCForm::GetTemplateMacro()
Retrieves the main template macro to be used for this form (default is 'html_form')
CCForm::GetTemplateVar()
Get template data to be passed to the template generator
CCForm::GetTemplateVars()
Get all template vars for this form (used by page generator)
CCForm::InnerInsertFormFields()
Put fields into a specific place into an array of fields
CCForm::InsertFormFields()
Put fields into a specific place in the form
CCForm::PopulateValues()
Populate the values of the field with specific data (e.g. a database record)
CCForm::SetFieldError()
Sets error text when a validator has failed on a given field.
CCForm::SetFormFieldItem()
Set the value for a specific element in a field's meta-data structure.
CCForm::SetFormHelp()
Alias for SetHelpText
CCForm::SetFormValue()
Set the value of an html form field.
CCForm::SetHandler()
Set the 'action' field of the form element. (The default is the current url.)
CCForm::SetHelpText()
Puts up a helper caption text above the form.
CCForm::SetHiddenField()
Creates a hidden form field and sets it's value
CCForm::SetSubmitText()
Set the text for the submit button. (Set to '' to remove the button from the form.)
CCForm::SetTemplateMacro()
Determines the main template macro to be used for this form (default is 'html_form')
CCForm::SetTemplateVar()
Set (or replace) a template field to be passed to the template generator
CCForm::TemplateVarExists()
Test if a specific form adornment template exists.
CCForm::ValidateFields()
Validates the fields in this form, called during POST processing.
CCForm::validator_checkbox()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_date()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_email()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_localdir()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_metalmacro()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_must_exist()
Generic 'check-for-null-value' validator for HTML field, called during ValidateFields()
CCForm::validator_passthru()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_password()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_pattern()
Validates the user against a regex pattern
CCForm::validator_radio()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_regex()
Validates that a regular expression will compile
CCForm::validator_select()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_statictext()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_tagsedit()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_textarea()
Handles validator for HTML field, called during ValidateFields()
CCForm::validator_textedit()
Handles validator for HTML field, called during ValidateFields()
CCForm::_fetch_post_value()
Internal: return a $_POST value to be used as a value

Class Details

[line 88]
Derive from this class to let the user modify the app's config

There are many derivations of this, one for each group of config variables. When you derive from this form, it will save the values here into the config table for use in all subsequent sessions. The derivations do not have to perform any action on user submit. The global config affects all users so typically only administrators will see derivations of this form.

  1. // Derive from the base
  2. class CCMyAdminForm extends CCEditConfigForm
  3. {
  4. function CCMyAdminForm()
  5. {
  6. $type_name = 'my-settings-type';
  7. $this->CCEditConfigForm($type_name);
  8. $fields = array(
  9. 'mySettting' => // name of the setting
  10. array(
  11. 'label' => 'Set this setting',
  12. 'form_tip' => 'make it good',
  13. 'value' => 'Admin',
  14. 'formatter' => 'textedit',
  15. 'flags' => CCFF_POPULATE | CCFF_REQUIRED ),
  16. );
  17.  
  18. $this->AddFormFields($fields);
  19. }
  20. }
  21.  
  22.  
  23. // Then later in the code when it's time to call it up, simply do:
  24. function ShowMyAdminForm()
  25. {
  26. CCPage::SetTitle('My Admin Form');
  27. $form = new CCMyAdminForm();
  28. CCPage::AddForm( $form->GenerateForm() );
  29. }
  30.  
  31. // Still later you can retreive the user's setting:
  32. function DoMyStuff()
  33. {
  34. $configs =& CCConfigs::GetTable();
  35. $settings = $configs->GetConfig('my-settings-type');
  36.  
  37. $value = $settings['mySetting'];
  38.  
  39. ///...
  40. }




[ Top ]


Class Variables

$_scope =

[line 95]

/* @access private


Type:   mixed


[ Top ]

$_typename =

[line 94]

/* @access private


Type:   mixed


[ Top ]



Class Methods


constructor CCEditConfigForm [line 104]

CCEditConfigForm CCEditConfigForm( string $config_type, [string $scope = ''])

Constructor



Parameters:

string   $config_type   The name of the settings group (i.e. 'menu')
string   $scope   CC_GLOBAL_SCOPE or a specific vroot (blank means current)

[ Top ]

method GenerateForm [line 131]

void GenerateForm( [boolean $hiddenonly = false])

Overrides base class in order to populate fields with current contents of environment's config.



Overrides CCForm::GenerateForm() (Prepares form variables for display.)

Parameters:

boolean   $hiddenonly  

[ Top ]

method SaveToConfig [line 156]

void SaveToConfig( )

Saves this forms data to the proper type of the current scope



Tags:



[ Top ]

method SetConfigType [line 146]

void SetConfigType( string $config_type)

Sets the config type (e.g. menu, settings, navpages, etc.) for the data (also done from ctor)



Parameters:

string   $config_type   The name of the settings group (i.e. 'menu')

[ Top ]

method SetModule [line 121]

void SetModule( string $module)

Config forms might be in modules not currently loaded. This method allows forms to specify which module to load during POST



Parameters:

string   $module   name of file to load to process form POST

[ Top ]


Documentation generated on Sat, 17 Nov 2007 01:03:13 +0000 by phpDocumentor 1.3.0RC4