\seekquarry\yioop\controllers\componentsStoreComponent

Component of the Yioop control panel used to handle activitys for managing advertisements. i.e., create advertisement, activate/ deactivate advertisement, edit advertisement.It is used by AdminController

Summary

Methods
Properties
Constants
__construct()
initializeWikiEditor()
manageCredits()
manageAdvertisements()
initializeAdKeywords()
trim_value()
$parent
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$parent

$parent : object

Reference to the controller this component lives on

Type

object

Methods

__construct()

__construct(object  $parent_controller) 

Sets up this component by storing in its parent field a reference to controller this component lives on

Parameters

object $parent_controller

reference to the controller this component lives on

initializeWikiEditor()

initializeWikiEditor(\seekquarry\yioop\controllers\components\array&  $data,   $id = "") 

Called to include the Javascript Wiki Editor (wiki.js) on a page and to send any localizations needed from PHP to Javascript-land It is used by both Crawl and SocialComponent

Parameters

\seekquarry\yioop\controllers\components\array& $data

an asscoiative array of data to be used by the view and layout that the wiki editor will be drawn on This method tacks on to INCLUDE_SCRIPTS to make the layout load wiki.js.

$id

if "" then all textareas on page will get editor buttons, if -1 then sets up translations, but does not add any button, otherwise, add buttons to textarea $id will. (Can call this method multiple times, if want more than one but not all)

manageCredits()

manageCredits() : array

Used to manage the purchase and storage of advertising credits

Returns

array —

$data field variables necessary for display of view

manageAdvertisements()

manageAdvertisements() : array

Used to handle the Create, Edit and Activation of Advertisements

Returns

array —

$data field variables necessary for display of view

initializeAdKeywords()

initializeAdKeywords(  $data, integer  $start_date, integer  $day_count) 

Sets up the $data['AD_KEYWORD'] as an associative array of (keyword, day) => bid_amounts based on min bid for that ad keyword on that day. Set up $data['EXPENSIVE_KEYWORD'] as the most expensive ad keyword for the dates in question and also sets up $data['AD_MIN_BID'] as the minimum bid required for the dates in question

Parameters

$data
integer $start_date

state date in seconds since beginning of Unix epoch

integer $day_count

number of days ad campaign will last

trim_value()

trim_value(\seekquarry\yioop\controllers\components\string&  $value) 

Trim white spaces callback for array_walk

Parameters

\seekquarry\yioop\controllers\components\string& $value

string to remove initial and trailing whitespace from