本文整理汇总了PHP中OX_Component::callOnComponents方法的典型用法代码示例。如果您正苦于以下问题:PHP OX_Component::callOnComponents方法的具体用法?PHP OX_Component::callOnComponents怎么用?PHP OX_Component::callOnComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OX_Component
的用法示例。
在下文中一共展示了OX_Component::callOnComponents方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildForm
/**
* Append type-specific form elements to the base form
*
* @param object &$form
* @param array &$row
*/
function buildForm(&$form, &$row)
{
$form->setAttribute("onSubmit", "return max_formValidateHtml(this.banner)");
$header = $form->createElement('header', 'header_html', $GLOBALS['strHTMLBanner'] . " - banner code");
$header->setAttribute('icon', 'icon-banner-html.gif');
$form->addElement($header);
$adPlugins = OX_Component::getComponents('3rdPartyServers');
$adPluginsNames = OX_Component::callOnComponents($adPlugins, 'getName');
$adPluginsList = array();
$adPluginsList[''] = $GLOBALS['strAdserverTypeGeneric'];
$adPluginsList['none'] = $GLOBALS['strDoNotAlterHtml'];
foreach ($adPluginsNames as $adPluginKey => $adPluginName) {
$adPluginsList[$adPluginKey] = $adPluginName;
}
$htmlG['textarea'] = $form->createElement('textarea', 'htmltemplate', null, array('class' => 'code', 'cols' => '45', 'rows' => '10', 'wrap' => 'off', 'dir' => 'ltr', 'style' => 'width:550px;'));
$aSelectAttributes = array('id' => 'adserver', 'style' => 'margin-left: 15px;width:230px');
$htmlG['select'] = HTML_QuickForm::createElement('select', 'adserver', $GLOBALS['strAlterHTML'], $adPluginsList, $aSelectAttributes);
$form->addGroup($htmlG, 'html_banner_g', null, array("<br>", ""), false);
$form->addElement('advcheckbox', 'iframe_friendly', $GLOBALS['strIframeFriendly']);
if ($row['bannerid'] && ($row['url'] || $row['target'])) {
// The "url" and "target" elements remain as part of the form definition
// for HTML banners only for existing banners that have either
// url or target already set.
$form->addElement('header', 'header_b_links', "Banner link");
$form->addElement('text', 'url', $GLOBALS['strURL']);
$form->addElement('text', 'target', $GLOBALS['strTarget']);
}
$form->addElement('header', 'header_b_display', 'Banner display');
$sizeG['width'] = $form->createElement('text', 'width', $GLOBALS['strWidth'] . ":");
$sizeG['width']->setSize(5);
$sizeG['height'] = $form->createElement('text', 'height', $GLOBALS['strHeight'] . ":");
$sizeG['height']->setSize(5);
if (!empty($row['bannerid'])) {
$sizeG['height']->setAttribute('onChange', 'oa_sizeChangeUpdateMessage("warning_change_banner_size");');
$sizeG['width']->setAttribute('onChange', 'oa_sizeChangeUpdateMessage("warning_change_banner_size");');
}
$form->addGroup($sizeG, 'size', $GLOBALS['strSize'], " ", false);
$form->addElement('hidden', 'ext_bannertype', $this->getComponentIdentifier());
//validation rules
$translation = new OX_Translation();
$widthRequiredRule = array($translation->translate($GLOBALS['strXRequiredField'], array($GLOBALS['strWidth'])), 'required');
$heightRequiredRule = array($translation->translate($GLOBALS['strXRequiredField'], array($GLOBALS['strHeight'])), 'required');
$numericRule = array($GLOBALS['strNumericField'], 'numeric');
$form->addGroupRule('size', array('width' => array($widthRequiredRule, $numericRule), 'height' => array($heightRequiredRule, $numericRule)));
}
示例2: buildForm
function buildForm(&$form, &$row)
{
$form->setAttribute("onSubmit", "return max_formValidateHtml(this.banner)");
$header = $form->createElement('header', 'header_html', $GLOBALS['strHTMLBanner']);
$header->setAttribute('icon', 'icon-banner-html.gif');
$form->addElement($header);
$adPlugins = OX_Component::getComponents('3rdPartyServers');
$adPluginsNames = OX_Component::callOnComponents($adPlugins, 'getName');
$adPluginsList = array();
$adPluginsList[''] = $GLOBALS['strAdserverTypeGeneric'];
$adPluginsList['none'] = $GLOBALS['strDoNotAlterHtml'];
foreach ($adPluginsNames as $adPluginKey => $adPluginName) {
$adPluginsList[$adPluginKey] = $adPluginName;
}
$form->addElement('select', 'adserver', $this->translate($GLOBALS['strAlterHTML']), $adPluginsList, $aSelectAttributes);
$form->addElement('header', 'header_b_parameters', $this->translate("Banner display"));
$form->addElement('text', 'p_link_url', $this->translate($GLOBALS['strURL']));
$form->addElement('text', 'p_link_text', $this->translate("Link text"));
$form->addElement('text', 'p_title', $this->translate("Title"));
$form->addElement('text', 'p_description', $this->translate("Description"));
$form->addElement('text', 'p_image_url', $this->translate("Url Image"));
$form->addElement('text', 'p_click_url_unesc', $this->translate("Click url Unesc"));
$form->addElement('hidden', 'ext_bannertype', $this->getComponentIdentifier());
$bannerId = $row['bannerid'];
if ($bannerId) {
$doBanners = OA_Dal::factoryDO('my_banners');
$doBanners->bannerid = $bannerId;
$doBanners->find(true);
$row['terra_link_url'] = $doBanners->terra_link_url;
$row['terra_link_text'] = $doBanners->terra_link_text;
$row['terra_title'] = $doBanners->terra_title;
$row['terra_description'] = $doBanners->terra_description;
$row['terra_image_url'] = $doBanners->terra_image_url;
$row['terra_click_url_unesc'] = $doBanners->terra_click_url_unesc;
$form->setDefaults(array('p_link_url' => $doBanners->terra_link_url, 'p_link_text' => $doBanners->terra_link_text, 'p_title' => $doBanners->terra_title, 'p_description' => $doBanners->terra_description, 'p_image_url' => $doBanners->terra_image_url, 'p_click_url_unesc' => $doBanners->terra_click_url_unesc));
}
}
示例3: test_callOnComponents
function test_callOnComponents()
{
$GLOBALS['_MAX']['CONF']['pluginPaths']['plugins'] = '/lib/OX/Plugin/tests/data/testExtensions/';
$GLOBALS['_MAX']['CONF']['pluginPaths']['admin'] = '/lib/OX/Plugin/tests/data/www/admin/plugins/';
$GLOBALS['_MAX']['CONF']['pluginGroupComponents'] = array('testGroup1' => 1, 'testGroup2' => 1);
$aComponents[] = OX_Component::factoryByComponentIdentifier('testExtension1:testGroup1:testComponent1');
$aComponents[] = OX_Component::factoryByComponentIdentifier('testExtension1:testGroup2:testComponent1');
$aResult = OX_Component::callOnComponents($aComponents, 'staticMethod');
$this->assertIsA($aResult, 'array');
$this->assertEqual(count($aResult), 2);
$this->assertEqual($aResult['0'], 'staticMethodResult1');
$this->assertEqual($aResult['1'], 'staticMethodResult2');
$aResult = OX_Component::callOnComponents($aComponents, 'staticMethodWithParams', array('foo'));
$this->assertIsA($aResult, 'array');
$this->assertEqual(count($aResult), 2);
$this->assertEqual($aResult['0'], 'staticMethodWithParams1=foo');
$this->assertEqual($aResult['1'], 'staticMethodWithParams2=foo');
}
示例4: disableComponentGroup
/**
* set a given plugin setting to false
*
* @param string $name
* @return boolean
*/
public function disableComponentGroup($name, $extends)
{
$aComponents = OX_Component::getComponents($extends, $name, true, false);
$aResult = OX_Component::callOnComponents($aComponents, 'onDisable');
foreach ($aResult as $componentIdentifier => $value) {
if (!$value) {
// Should I call onEnable for those components that were sucessfully disabled?
return false;
}
}
return $this->_setPlugin($name, 0);
}
示例5: _getEarliestLoggedDeliveryData
/**
* A private method to calculate an equivalent "last time that maintenance
* statistics was run" value from logged delivery data, if possible.
*
* Enables the MSE process to be kick-started for new installations, where
* the MSE has not been run before; but without causing the MSE to run
* until the installation is actually logging data.
*
* @access private
* @param integer $type The update type that "occurred" - that is,
* OX_DAL_MAINTENANCE_STATISTICS_UPDATE_OI if the required
* calculated "update date" needs to be in terms of the
* operation interval; or
* OX_DAL_MAINTENANCE_STATISTICS_UPDATE_HOUR if the
* required calculated "update date" needs to be in terms
* of the hour.
* @return Date A Date representing the end of the operation interval
* which is before the date found of the earliest known
* logged delivery data record. Returns null if no logged
* delivery data can be located.
*/
function _getEarliestLoggedDeliveryData($type)
{
// Obtain all components from the deliveryLog plugin group
$aDeliveryLogComponents = OX_Component::getComponents('deliveryLog');
// Are there any components?
if (empty($aDeliveryLogComponents)) {
return null;
}
// Call the "getEarliestLoggedDataDate()" method on each
// component, to find out what is the date of the earliest
// logged data that the component knows about
$aResult = OX_Component::callOnComponents($aDeliveryLogComponents, 'getEarliestLoggedDataDate');
if ($aResults === false) {
return null;
}
// Iterate over the results from above, and see if any of
// the components returned valid dates, and if so, which
// of the results is the earliest
$oDate = null;
foreach ($aResult as $oComponentDate) {
if (is_a($oComponentDate, 'Date')) {
// Logged data was located! Is this date earlier than
// any previous "earliest" logged delivery data?
if (is_null($oDate)) {
$oDate = new Date();
$oDate->copy($oComponentDate);
} else {
if ($oComponentDate->before($oDate)) {
$oDate->copy($oComponentDate);
}
}
}
}
// Was a date found?
if (is_null($oDate) || !is_a($oDate, 'Date')) {
return null;
}
// Convert the located earliest logged data date into either the
// end of the previous operation interval, or the end of the previous
// hour, depending on the required type
if ($type == OX_DAL_MAINTENANCE_STATISTICS_UPDATE_OI) {
$aDates = OX_OperationInterval::convertDateToPreviousOperationIntervalStartAndEndDates($oDate);
} else {
$aDates = OX_OperationInterval::convertDateToPreviousOperationIntervalStartAndEndDates($oDate, 60);
}
// Return the date
return $aDates['end'];
}