Comments: on this page. Click to read or post your own.

Class GenericDataAdmin

Description

Provides a common interface for searching, viewing and editing DataObjects.

Extend the class to adjust functionality to your specific DataObjects.

  • deprecated: Use ModelAdmin instead, it's much more advanced and does much more for you.
  • abstract:

Located in /cms/code/GenericDataAdmin.php (line 11)

Object
   |
   --ViewableData
      |
      --RequestHandlingData
         |
         --Controller
            |
            --LeftAndMain
               |
               --GenericDataAdmin
Variable Summary
static mixed $allowed_actions
static mixed $csv_columns
static string $data_type
static mixed $data_type_extra
static mixed $result_columns
static string $result_format
mixed $filter
Method Summary
GenericDataAdmin __construct ()
void AddForm ()
void buildResultFieldValue ($result $result, $field $field)
void columnbody ([ $results = null])
void columnheader ()
String createRecord ( $data,  $form)
String DataTypePlural ()
String DataTypeSingular ()
String delete ($urlParams $urlParams, $form $form)
void export ()
void ExportForm ()
Form getEditForm ($id $id)
String getLink ()
void getRelatedData ()
String getResultActionsForm ($results $results)
void getResultList ( $results, [ $link = true])
void getResults ( $data,  $form)
String getResultTable ($results $results, [$link $link = true])
void htmlTableCell ( $value, [ $link = false], [ $class = ""], [ $id = null])
void htmlTableRow ( $value, [ $link = null], [ $evenOrOdd = null])
void init ()
void Link ()
void listbody ([ $results = null])
String Results ()
String save ( $urlParams,  $form)
Array show ()
Variables
static mixed $allowed_actions = array(
'createRecord',
'delete',
'export',
'getResults',
'save',
'show',
'CreationForm',
'ExportForm',
'SearchForm',
)
(line 12)

Redefinition of:
LeftAndMain::$allowed_actions
static mixed $csv_columns (line 60)
static string $data_type (line 36)
static mixed $data_type_extra (line 38)
static mixed $result_columns (line 52)

Specifies which information should be listed in the results-box, either in "table"- or "list"-format (see {$result_format}).

Format "table": array( 'AccountName' => 'AccountName' )

Format "list": see {@DataObject->buildNestedUL}

static string $result_format = "table" (line 58)
  • var: Either "table" or "list". List-format also supports second level results.
mixed $filter (line 24)
  • access: public
FieldSet $result_actions (line 31)
  • var: Specifies which {Actions} can be performed on a resultset, e.g. "Export" or "Send". The form contains the resultset as CSV for further processing. These actions can be extended in a subclassed constructor.
  • access: protected

Inherited Variables

Inherited from LeftAndMain

LeftAndMain::$application_link
LeftAndMain::$application_logo
LeftAndMain::$application_logo_style
LeftAndMain::$application_logo_text
LeftAndMain::$application_name
LeftAndMain::$extra_requirements
LeftAndMain::$ForceReload
LeftAndMain::$loading_image
LeftAndMain::$menu_items
LeftAndMain::$tree_class

Inherited from Controller

Controller::$action
Controller::$baseInitCalled
Controller::$basicAuthEnabled
Controller::$controller_stack
Controller::$request
Controller::$requestParams
Controller::$response
Controller::$session
Controller::$urlParams
Controller::$url_handlers

Inherited from ViewableData

ViewableData::$casting
ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache

Inherited from Object

Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Methods
Constructor __construct (line 64)
GenericDataAdmin __construct ()

Redefinition of:
Object::__construct()
AddForm (line 685)

Legacy

void AddForm ()
buildResultFieldValue (line 383)
  • access: protected
void buildResultFieldValue ($result $result, $field $field)
  • $result $result
  • $field $field: Mixed can be array: eg: array("FirstName", "Surname"), in which case two fields in database table should concatenate to one cell for report table. The field could be "Total->Nice" or "Order.Created->Date", intending to show its specific format. Caster then is "Nice" "Date" etc.
columnbody (line 318)
  • access: protected
void columnbody ([ $results = null])
  • $results
columnheader (line 310)
  • access: protected
void columnheader ()
createRecord (line 557)

Add a new DataObject

String createRecord ( $data,  $form)
  • $data
  • $form
CreationForm (line 129)
Form CreationForm ()
DataTypePlural (line 122)
String DataTypePlural ()
DataTypeSingular (line 115)
String DataTypeSingular ()
delete (line 578)

Delete a given Dataobjebt by ID

String delete ($urlParams $urlParams, $form $form)
  • $urlParams $urlParams: Array
  • $form $form: Form
EditForm (line 139)
Form EditForm ()

Redefinition of:
LeftAndMain::EditForm()
export (line 453)

Exports a given set of comma-separated IDs (from a previous search-query, stored in a HiddenField).

Uses {$csv_columns} if present, and falls back to {$result_columns}.

void export ()
ExportForm (line 147)
void ExportForm ()
getEditForm (line 180)

Determines fields and actions for the given {$data_type}, and populates these fields with values from {$data_type} and any connected {$data_type_extra}.

Adds default actions ("save" and "delete") if no custom actions are found. Returns an empty form if no fields or actions are found (on first load).

Form getEditForm ($id $id)
  • $id $id: Number
getLink (line 678)

Provide custom link.

  • abstract:
String getLink ()
getRelatedData (line 594)
  • access: protected
void getRelatedData ()
getResultActionsForm (line 351)
  • return: Form-Content
String getResultActionsForm ($results $results)
  • $results $results: Array
getResultList (line 280)
void getResultList ( $results, [ $link = true])
  • $results
  • $link
getResults (line 276)
void getResults ( $data,  $form)
  • $data
  • $form
getResultTable (line 294)
  • return: Result-Table as HTML
String getResultTable ($results $results, [$link $link = true])
  • $results $results
  • $link $link: Link the rows to their according result (evaluated by javascript)
getSearchFields (line 671)

Form fields which trigger {getResults} and {peformSearch}.

Provide HTML in the following format to get auto-collapsing "advanced search"-fields. <div id="BasicSearchFields"></div> <div class="ToggleAdvancedSearchFields" style="display:none"><a href="#">Show advanced options</a></div> <div id="AdvancedSearchFields"></div>

  • abstract:
FieldSet getSearchFields ()
htmlTableCell (line 433)
  • access: protected
void htmlTableCell ( $value, [ $link = false], [ $class = ""], [ $id = null])
  • $value
  • $link
  • $class
  • $id
htmlTableRow (line 441)
  • access: protected
void htmlTableRow ( $value, [ $link = null], [ $evenOrOdd = null])
  • $value
  • $link
  • $evenOrOdd
init (line 76)

Sets Requirements and checks for Permissions.

Subclass this function to add custom Requirements.

void init ()

Redefinition of:
LeftAndMain::init()
Link (line 107)
void Link ()

Redefinition of:
LeftAndMain::Link()
You should implement a Link() function in your subclass of LeftAndMain, to point to the URL of that particular controller.
listbody (line 343)
  • access: protected
void listbody ([ $results = null])
  • $results
performSearch (line 660)

Execute a query based on {$filter} and build a DataObjectSet out of the results.

  • abstract:
DataObjectSet performSearch ()
Results (line 239)

Display the results of the search.

String Results ()
save (line 490)

Save generic data handler

  • return: Statusmessage
String save ( $urlParams,  $form)
  • $urlParams
  • $form

Redefinition of:
LeftAndMain::save()
Save and Publish page handler
SearchForm (line 161)
Form SearchForm ()
show (line 537)

Show a single record

  • return: Editing Form
Array show ()

Redefinition of:
LeftAndMain::show()
updateRelatedKey (line 643)
  • access: protected
void updateRelatedKey ()

Inherited Methods

Inherited From LeftAndMain

LeftAndMain::addTreeNodeJS()
LeftAndMain::add_menu_item()
LeftAndMain::ajaxupdateparent()
LeftAndMain::ajaxupdatesort()
LeftAndMain::ApplicationLink()
LeftAndMain::callPageMethod()
LeftAndMain::canAccessCMS()
LeftAndMain::canAdminCMS()
LeftAndMain::clear_menu()
LeftAndMain::CMSVersion()
LeftAndMain::currentPage()
LeftAndMain::currentPageID()
LeftAndMain::deleteitems()
LeftAndMain::deleteTreeNodeJS()
LeftAndMain::EditForm()
LeftAndMain::EditorToolbar()
LeftAndMain::ForceReload()
LeftAndMain::getActionUpdateJS()
LeftAndMain::getApplicationLogoText()
LeftAndMain::getApplicationName()
LeftAndMain::getitem()
LeftAndMain::getLastFormIn()
LeftAndMain::getRecord()
LeftAndMain::getSiteTreeFor()
LeftAndMain::getsubtree()
LeftAndMain::getTemplatesWithSuffix()
LeftAndMain::get_menu_item()
LeftAndMain::get_menu_items()
LeftAndMain::init()
LeftAndMain::isCurrentPage()
LeftAndMain::Left()
LeftAndMain::Link()
LeftAndMain::LoadingImage()
LeftAndMain::LogoStyle()
LeftAndMain::MainMenu()
LeftAndMain::MceRoot()
LeftAndMain::Member_ProfileForm()
LeftAndMain::myprofile()
LeftAndMain::populate_default_menu()
LeftAndMain::printable()
LeftAndMain::remove_menu_item()
LeftAndMain::replace_menu_item()
LeftAndMain::require_css()
LeftAndMain::require_javascript()
LeftAndMain::require_themed_css()
LeftAndMain::returnItemToUser()
LeftAndMain::Right()
LeftAndMain::RightBottom()
LeftAndMain::save()
LeftAndMain::SectionTitle()
LeftAndMain::setApplicationName()
LeftAndMain::setCurrentPageID()
LeftAndMain::setLogo()
LeftAndMain::set_loading_image()
LeftAndMain::show()

Inherited From Controller

Controller::AbsoluteLink()
Controller::can()
Controller::curr()
Controller::currentController()
Controller::CurrentMember()
Controller::defaultAction()
Controller::disableBasicAuth()
Controller::getAction()
Controller::getFormOwner()
Controller::getRequest()
Controller::getResponse()
Controller::getSession()
Controller::getURLParams()
Controller::getViewer()
Controller::handleAction()
Controller::handleRequest()
Controller::has_curr()
Controller::init()
Controller::isAjax()
Controller::join_links()
Controller::LinkTo()
Controller::Now()
Controller::PastMember()
Controller::PastVisitor()
Controller::popCurrent()
Controller::pushCurrent()
Controller::redirect()
Controller::redirectedTo()
Controller::render()
Controller::setSession()
Controller::setURLParams()

Inherited From RequestHandlingData

RequestHandlingData::checkAccessAction()
RequestHandlingData::getRequest()
RequestHandlingData::handleRequest()
RequestHandlingData::httpError()

Inherited From ViewableData

ViewableData::ATT_val()
ViewableData::BaseHref()
ViewableData::buildCastingHelperCache()
ViewableData::cachedCall()
ViewableData::castingHelper()
ViewableData::castingHelperPair()
ViewableData::castingObjectCreator()
ViewableData::castingObjectCreatorPair()
ViewableData::CSSClasses()
ViewableData::CurrentMember()
ViewableData::CurrentPage()
ViewableData::customise()
ViewableData::Debug()
ViewableData::defineMethods()
ViewableData::escapeTypeForField()
ViewableData::Even()
ViewableData::EvenOdd()
ViewableData::First()
ViewableData::FirstLast()
ViewableData::getField()
ViewableData::getIterator()
ViewableData::getXMLValues()
ViewableData::hasField()
ViewableData::HasPerm()
ViewableData::hasValue()
ViewableData::i18nLocale()
ViewableData::IsAjax()
ViewableData::iteratorProperties()
ViewableData::JS_val()
ViewableData::Last()
ViewableData::Me()
ViewableData::Middle()
ViewableData::MiddleString()
ViewableData::obj()
ViewableData::Odd()
ViewableData::Pos()
ViewableData::RAW_val()
ViewableData::renderWith()
ViewableData::SecurityID()
ViewableData::setCustomisedObj()
ViewableData::setField()
ViewableData::SQL_val()
ViewableData::ThemeDir()
ViewableData::Top()
ViewableData::TotalItems()
ViewableData::val()
ViewableData::XML_val()
ViewableData::__get()
ViewableData::__isset()
ViewableData::__set()

Inherited From Object

Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
blog comments powered by Disqus

Documentation generated on Tue, 07 Oct 2008 15:57:23 +1300 by phpDocumentor 1.3.2