classes/php5_classes/Fields.class.php

Properties

Description

Holds the geoFields and geoFieldsField classes.

Classes

geoFields

Properties

 
 
System  
No 
No 

Description

Class that holds settings information for fields to use.

Methods

__construct, __get, __isset, __set, __unset, copy, getCategoryId, getDefaultFields, getDefaultLocations, getDisplayLocationFields, getField, getGroupId, getInstance, getListingTagsMeta, getModuleFields, remove, serialize, toArray, touch, unserialize,

__construct( int   $groupId, int   $categoryId, ) : n/a

Description

Constructor, this cannot be run by itself, must get an instance using geoFields::getInstance($categoryId). This constructor finds the category to pull the fields to use from, then gets the settings.

Arguments

Name Type Description Default
$groupId int
$categoryId int

Return value

Type Description
n/a n/a

__get( string   $name, ) : mixed

Description

Allows using $fields->name that returns a value based on:
If default field is already set: returns the permission for that field, for example $fields->is_required If default field is NOT set: acts just like $fields->getField() was called.

Arguments

Name Type Description Default
$name string

Return value

Type Description
mixed

__isset( string   $name, ) : bool

Description

Magic method to allow something like isset($fields->field_name) to see if a given field even exists at all.

Arguments

Name Type Description Default
$name string

Return value

Type Description
bool

__set( string   $name, mixed   $value, ) : n/a

Description

NOT IMPLEMENTED! Do not use $fields->name = .
.. as it won't work. This is here for completeness only, if need to change a field edit it through the geoFieldsField object.

Arguments

Name Type Description Default
$name string
$value mixed

Return value

Type Description
n/a n/a

__unset( string   $name, ) : n/a

Description

Magic method to allow un-setting a field using unset($fields->field_name).
It is not recommended to use this except internally.

Arguments

Name Type Description Default
$name string

Return value

Type Description
n/a n/a

copy( int   $from_category, int   $to_category, ) : n/a

Description

Specifically used in category admin, when making a copy of a category.
.

Arguments

Name Type Description Default
$from_category int
$to_category int

Return value

Type Description
n/a n/a

getCategoryId( ) : int

Description

Gets the category ID for this fields object.

Return value

Type Description
int

getDefaultFields( int   $groupId = 0, int   $categoryId = 0, ) : array

Description

Gets the default fields and info for each field.
Returns an array like this: array ( 'section_index' => array ( 'legend' => 'Section Admin title', 'fields' => array ( 'field_index' => array ( 'label' => 'Admin label', 'type' => 'text', //(one of the types built in) 'type_label' => 'Type Admin Label',//optional 'type_select' => false, //optional, if true, admin will be able to change type for the field 'opt_name_set' => true, //optional, only used for optional site-wide fields 'opt_num' => $i, //optional, only used for optional site-wide fields 'skipData' => array, //optional, array of field settings to skip, such as 'can_edit' 'skipLocations' => array, //optional, array of locations that should NOT show an option for this field, or boolean true to skip all locations ), ... ), ), ... )

Arguments

Name Type Description Default
$groupId int

Does not affect core fields returned but it may affect addon fields depending on addon.

0
$categoryId int

Does not affect core fields returned but it may affect addon fields depending on addon.

0

Return value

Type Description
array A multi-dimensional array in the format specified above.

getDefaultLocations( int   $groupId = 0, int   $categoryId = 0, string   $type = 'all', ) : array

Description

Gets the default "locations" in an array of "reference" => "admin label" entries.

Arguments

Name Type Description Default
$groupId int

Does not affect core locations returned but it may affect addon locations depending on addon.

0
$categoryId int

Does not affect core locations returned but it may affect addon locations depending on addon.

0
$type string

Either 'all', 'page', 'module', 'pic_module', or 'addon', for what type of locations to return. Param added in version 6.0.0

'all'

Return value

Type Description
array

getDisplayLocationFields( string   $locationName, string   $addon = '', ) : array

Description

Gets an associative array of which fields are configured to display the given location, each key is the field name and the value is whether it is configured to display in the given location.

Arguments

Name Type Description Default
$locationName string
$addon string

If wanting to get location added by specific addon, enter the addon folder name in this var. This is the equivelent of calling getDisplayLocationFields ('addon-'.$addon.'-'.$locationName) without specifying addon.

''

Return value

Type Description
array

getField( string   $fieldName, ) : \geoFieldsField|null

Description

Gets the geoFieldsField object for the specified field name.

Arguments

Name Type Description Default
$fieldName string

Return value

Type Description
\geoFieldsField|null

getGroupId( ) : int

Description

Gets the group ID for the fields object.

Return value

Type Description
int

getInstance( int   $groupId = 0, int   $categoryId = 0, ) : \geoFields

Description

Gets an instance based on the group and category ID.

Arguments

Name Type Description Default
$groupId int 0
$categoryId int 0

Return value

Type Description
\geoFields

getListingTagsMeta( array   $include_types = array('field', 'label', 'tag'), bool   $flatArray = false, ) : array

Description

Gets meta info for all the listing info that can be displayed by the {listing} tag, plus info about label fields only available on listing details page.

Arguments

Name Type Description Default
$include_types array

Narrow which types of tags (field, label, or tag) only the types included in the array are returned.

array('field', 'label', 'tag')
$flatArray bool

Whether to return flat array or not

false

Return value

Type Description
array

Tags

Name Description
since Version 7.1.0

getModuleFields( string   $module, ) : array

Description

Gets module display fields for given module name

Arguments

Name Type Description Default
$module string

Return value

Type Description
array

Tags

Name Description
since Version 6.0.0

remove( int   $group = null, int   $category = null, ) : n/a

Description

Remove all fields to use settings for specific group/category. If group is null, it will remove for all that match the set category. Same goes if group is null and category is set. If both are set (even to 0), will ONLY remove settings that match both.
This will NOT work to remove group 0 and category 0. This is meant primarily to be called by other methods, such as when removing a category from the system or removing a group from the system. As such it is meant to be as optimized as possible.

Arguments

Name Type Description Default
$group int null
$category int null

Return value

Type Description
n/a n/a

Tags

Name Description
since Version 6.0.6

serialize( ) : bool

Description

Serializes the geoFields data, saved to the database.

Return value

Type Description
bool

toArray( ) : array

Description

Converts the fields to an array.

Return value

Type Description
array Associative array of geoFieldsField objects, one array entry for each field.

touch( ) : n/a

Description

Called internally to signify that changes have been made to the settings that may need to be saved to the database.

Return value

Type Description
n/a n/a

unserialize( ) : n/a

Description

Gets the fields to use based on the category set in $this->_category.
Not normal to call this directly, as it is called when the geoFields is first created, but this can still be called if needed to refresh settings.

Return value

Type Description
n/a n/a

Properties

$_category, $_fields, $_group, $_pendingChanges, $_requestedCategory, $_requestedGroup,

int  private  $_category =

The category used for the fields to use, if the requested category was not found, it "bubbles up" until one with category specific settings ARE found.


array  private  $_fields =

The field's settings for each of the different fields it could find.


int  private  $_group =

The group used for the fields to use, or 0 if using site-wide


bool  private  $_pendingChanges = false

Whether or not there are pending changes in the fields we have


int  private  $_requestedCategory =

The "requested" category ID


int  private  $_requestedGroup =

The "requested" group ID


geoFieldsField

Properties

 
 
System  
No 
No 

Description

A mini object to hold data about a specific field.

Methods

__construct, __get, __isset, __set, addLocation, clean, clearLocations, getAllFields, serialize, toArray, touch,

__construct(   $data,   $parent, ) : n/a

Description

Constructor, sets up field's data. Note that geoFieldsField objects should normally not be created outside of the geoFields class. If not done correctly, the object will be marked as "invalid" and will be non-functional.

Arguments

Name Type Description Default
$data n/a
$parent n/a

Return value

Type Description
n/a n/a

__get( string   $name, ) : n/a

Description

Magic method, allows syntax like $field->is_enabled

Arguments

Name Type Description Default
$name string

Return value

Type Description
n/a n/a

__isset( string   $name, ) : n/a

Description

Magic method to see if the given setting is set or not using syntax like isset($field->is_enabled).

Arguments

Name Type Description Default
$name string

Return value

Type Description
n/a n/a

__set( string   $name, mixed   $value, ) : n/a

Description

Magic method, allows changing values using $field->is_enabled = true (for instance) to change the different settings for this field.

Arguments

Name Type Description Default
$name string
$value mixed

Return value

Type Description
n/a n/a

addLocation( string   $name, ) : n/a

Description

Adds a location to the locations this field should be displayed in.

Arguments

Name Type Description Default
$name string

Return value

Type Description
n/a n/a

clean( string   $name, mixed   $value, ) : mixed

Description

Cleans a value according to what field the value is for.

Arguments

Name Type Description Default
$name string

the field name that is being cleaned

$value mixed

Return value

Type Description
mixed The cleaned value.

clearLocations( ) : n/a

Description

Removes all locations this field should be displayed in.

Return value

Type Description
n/a n/a

getAllFields( ) : \geoFields

Description

Gets the geoFields object with all the fields in it including this one.

Return value

Type Description
\geoFields

serialize( ) : bool

Description

Serializes settings for this field to the database.

Return value

Type Description
bool

toArray( ) : array

Description

Returns an array of the data for this field.

Return value

Type Description
array

touch( ) : n/a

Description

Lets the object know there are pending changes that might need to be serialized.

Return value

Type Description
n/a n/a
Documentation was generated by phpDocumentor 2.2.0 .

Namespaces

  • global

    Packages

    • Default
      • ExampleAddon
        • addon_example_admin
          In charge of doing stuff on the admin side, this is optional.
        • addon_example_info
          Required class for addons, this is the Addon information class, used by the addon system to determine what the addon can do. Also contains info about the addon that can be viewed in the addon management page in the admin.
        • addon_example_pages
          Addon page class, used by the addon system to display pages on the client side.
        • addon_example_setup
          This class is not required. If it, and the function for a particular routine exist, then that function will be called IN ADDITION TO the automated routines of the addon framework.
        • addon_example_tags
          Expects one function for each tag. Function name should be the same as the tag name. Can also have a constructor if anything needs to be constructed.
        • addon_example_util
          This is where to put functions that the main part of the addon will use.
        • eWidgetOrderItem
          This order item is designed to allow users on your site to purchase an eWidget.
      • System
        • DataAccess
          This is the main Database access object.
        • Singleton
          Singleton method class
        • _templateOrderItem
          Developers: use this file as a template to create a new order item.
        • _templatePaymentGateway
          This is the "developer template" payment gateway handler, a developer could use this file as a starting point for creating a new payment gateway in the system.
        • geoAPI
          The main system class for receiving and handling remote API calls, this acts as a translation layer between the communication with the "outside" and each API call.
        • geoAddon
          This is the class that handles anything and everything to do with addons.
        • geoArrayTools
          Utility functions for manipulating arrays
        • geoBrowse
          Contains functions common to browsing listings
        • geoBrowsingFilter
          System for activating, storing, and deactivating browsing filters.
        • geoCJAX
          Class that wraps the CJAX_FRAMEWORK, used to get the CJAX class.
        • geoCache
          This is the main part of the Geo cache system, it does all the "low level" stuff like writing files and escaping cache data.
        • geoCacheModule
          Part of Geo Cache system, specifically tuned to work best with cacheing module data (which will be an array).
        • geoCachePage
          Cache system specifically tuned to work best with cacheing output of pages and modules
        • geoCacheSetting
          Part of Geo Cache system, specifically tuned to work best with cacheing site-wide key=value type settings.
        • geoCacheText
          Part of Geo Cache system, this part specifically tuned to work best with cacheing language specific messages.
        • geoCalendar
          Holds utility method(s) for manipulating stuff dealing with calendar selector.
        • geoCart
          This class is behind the cart, loading all the order items and such and displaying, and processing all the different pages.
        • geoCategory
          Utility class that holds various methods to do stuff with categories in the system.
        • geoCombineResources
          This class helps to combine CSS and JS files, minify them, and optionally compress them.
        • geoCron
          This is the cron job backend, it handles all the communication and security and all that.
        • geoCrypt
          Class to use for encrypting information that needs to be able to be retrieved later.
        • geoDate
          Holds utility method(s) for manipulating stuff dealing with dates.
        • geoEmail
          Class that sends out e-mails.
        • geoFields
          Class that holds settings information for fields to use.
        • geoFieldsField
          A mini object to hold data about a specific field.
        • geoFile
          As the name implies, this is used for file-based utility methods.
        • geoFilter
          A few utility methods, good for filtering stuff.
        • geoFormatString
          Used to display a message nice and pretty, we'll probably be getting rid of this class though so don't go crazy using it.
        • geoHTML
          Class to generate chunks of HTML that are very common, used the most in the admin panel.
        • geoImage
          This class is responsible for a lot of the image processing, along with other aspects like generating the image tag for thumbnails.
        • geoInvoice
          This is the invoice object representing an invoice in the system.
        • geoLeveledField
          Class for doing common things with leveled fields.
        • geoListing
          A listing object, basically a container object for particular listing.
        • geoListingDisplay
          This is basically a container that is responsible for helping to display {listing .
        • geoListingFeed
          Class that helps to render RSS or other types of feeds based on list of listings.
        • geoMaster
          This is dedicated class for getting the value of, and setting, the various "master switches" within the software. Since this is meant as an easy way to get the values of master switches, most of the methods are static.
        • geoNumber
          Utility functions relating to number conversion/manipulation/validation ect.
        • geoOrder
          The geoOrder object, an object representation of an order in the system.
        • geoOrderItem
          The class that all order items must extend.
        • geoPC
          Used for login credential validation, password hashing, etc. along with software licensing.
        • geoPagination
          Utility functions useful for generating pagination of a results page such as when browing ads or searching
        • geoPaymentGateway
          This class should be extended by each different payment gateway, this will have some default functions that each gateway will inherit, and also has a few final static methods used by the system to affect all order items.
        • geoPlanItem
          A container to hold settings for a particular order item type, according to price plan ID, and optionally category ID for category specific settings.
        • geoRecurringBilling
          The geoRecurringBilling object, an object representation of a recurring billing in the system.
        • geoRegion
          Stuff for regions and sub-regions.
        • geoRegistry
          Handy little object, can be used to set registry type settings.
        • geoSearchUtils
          Class for search utilities.
        • geoSellerBuyer
          Handles back-end for the seller/buyer payment gateways, to allow the buyer to more easily pay the seller for a won auction. This handles the underlying system, but the actual work is done by individual seller/buyer gateways, for instance the Paypal buy-now functionality.
        • geoSession
          Manages session storage and session cookies for user sessions.
        • geoString
          Utility functions relating to languages and string manipulation.
        • geoStringData
          This class is to store accented chars, to be used by {@link geoString::removeAccents()}, mainly to keep the String.class.php file un-cluttered.
        • geoTable
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableRow
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableRowset
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableSelect
          Class used to generate a select query, useful when multiple areas want to affect a single query, for instance when generating a search query and there are addons involved.
        • geoTables
          Used to hold database table names, used throughout the code.
        • geoTemplate
          Template object that extends the Smarty class (a 3rd party library) to enable using templates to display things.
        • geoTransaction
          This is the object used for a transaction in the order and invoice system.
        • geoUser
          An object representative of a certain user in the system.
        • geoUserRating
          Store, retrieve, and display inter-user ratings
        • geoUtil
          Misc utility functions
        • geoView
          As the name implies, this is used for creating the page view. It does take a little setup (like any class), the setup is normally done in the display_page method in geoSite, or display_page in geoAdmin if displaying a page in the admin.
        • iApiTransport
          Interface for API Transports, a transport must implement this interface for the system to use it.
        • iOrderItem
          You cannot have abstract static functions, so instead need to have an interface to force the given static functions to be defined.
        • metaDbTables
          Used so that old locations that use the old name geoTables will still work.