本文整理匯總了PHP中FabrikHelperHTML::runConentPlugins方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::runConentPlugins方法的具體用法?PHP FabrikHelperHTML::runConentPlugins怎麽用?PHP FabrikHelperHTML::runConentPlugins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::runConentPlugins方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display
/**
* Display
*
* @param string $tpl Template
*
* @return void
*/
public function display($tpl = null)
{
FabrikHelperHTML::framework();
$app = JFactory::getApplication();
$input = $app->input;
$state = $this->get('State');
$item = $this->get('Item');
$document = JFactory::getDocument();
$srcs = array('media/com_fabrik/js/icons.js', 'media/com_fabrik/js/icongen.js', 'media/com_fabrik/js/canvas.js', 'media/com_fabrik/js/history.js', 'media/com_fabrik/js/keynav.js', 'media/com_fabrik/js/tabs.js', 'media/com_fabrik/js/pages.js', 'media/com_fabrik/js/frontpackage.js');
FabrikHelperHTML::script($srcs);
FabrikHelperHTML::stylesheet('media/com_fabrik/css/package.css');
$canvas = $item->params->get('canvas');
// $$$ rob 08/11/2011 test if component name set but still rendering
// in option=com_fabrik then we should use fabrik as the package
if ($input->get('option') === 'com_fabrik') {
$item->component_name = 'fabrik';
}
$opts = JArrayHelper::getvalue($canvas, 'options', array());
$tabs = JArrayHelper::getValue($canvas, 'tabs', array('Page 1'));
$tabs = json_encode($tabs);
$d = new stdClass();
$layout = JArrayHelper::getValue($canvas, 'layout', $d);
$layout = json_encode(JArrayHelper::getValue($canvas, 'layout', $d));
$id = $this->get('State')->get('package.id');
$script = "window.addEvent('fabrik.loaded', function() {\n\t\t\tnew FrontPackage({\n\t\ttabs : {$tabs},\n\t\ttabelement : 'packagemenu',\n\t\tpagecontainer : 'packagepages',\n\t\tlayout: {$layout},\n\t\t'packageId': {$id},\n\t\t'package':'{$item->component_name}'\n\t});\n\t\t});";
FabrikHelperHTML::addScriptDeclaration($script);
// Force front end templates
$this->_basePath = COM_FABRIK_FRONTEND . '/views';
$tmpl = !isset($item->template) ? 'default' : $item->template;
$this->addTemplatePath($this->_basePath . '/' . $this->_name . '/tmpl/' . $tmpl);
$text = $this->loadTemplate();
FabrikHelperHTML::runConentPlugins($text);
echo $text;
}
示例2: output
/**
* Actually load the template and echo the view html
* will process jplugins if required.
*
* @return void
*/
protected function output()
{
$app = JFactory::getApplication();
$input = $app->input;
$profiler = JProfiler::getInstance('Application');
$text = $this->loadTemplate();
JDEBUG ? $profiler->mark('template loaded') : null;
$model = $this->getModel();
$params = $model->getParams();
if ($params->get('process-jplugins')) {
FabrikHelperHTML::runConentPlugins($text);
}
JDEBUG ? $profiler->mark('end fabrik display') : null;
// $$$ rob 09/06/2011 no need for isMambot test? should use ob_start() in module / plugin to capture the output
echo $text;
}
示例3: process
/**
* Do the plugin action
*
* @param array &$data data
*
* @return int number of records updated
*/
public function process(&$data)
{
$app = JFactory::getApplication();
jimport('joomla.mail.helper');
$params = $this->getParams();
$msg = $params->get('message');
FabrikHelperHTML::runConentPlugins($msg);
$to = explode(',', $params->get('to'));
$w = new FabrikWorker();
$MailFrom = $app->getCfg('mailfrom');
$FromName = $app->getCfg('fromname');
$subject = $params->get('subject', 'Fabrik cron job');
$eval = $params->get('cronemail-eval');
$condition = $params->get('cronemail_condition', '');
$updates = array();
$this->log = '';
foreach ($data as $group) {
if (is_array($group)) {
foreach ($group as $row) {
if (!empty($condition)) {
$this_condition = $w->parseMessageForPlaceHolder($condition, $row);
if (eval($this_condition) === false) {
continue;
}
}
$row = JArrayHelper::fromObject($row);
foreach ($to as $thisto) {
$thisto = $w->parseMessageForPlaceHolder($thisto, $row);
if (FabrikWorker::isEmail($thisto)) {
$thismsg = $w->parseMessageForPlaceHolder($msg, $row);
if ($eval) {
$thismsg = eval($thismsg);
}
$thissubject = $w->parseMessageForPlaceHolder($subject, $row);
$mail = JFactory::getMailer();
$res = $mail->sendMail($MailFrom, $FromName, $thisto, $thissubject, $thismsg, true);
if (!$res) {
$this->log .= "\n failed sending to {$thisto}";
}
} else {
$this->log .= "\n {$thisto} is not an email address";
}
}
$updates[] = $row['__pk_val'];
}
}
}
$field = $params->get('cronemail-updatefield');
if (!empty($updates) && trim($field) != '') {
// Do any update found
$listModel = JModelLegacy::getInstance('list', 'FabrikFEModel');
$listModel->setId($params->get('table'));
$table = $listModel->getTable();
$connection = $params->get('connection');
$field = $params->get('cronemail-updatefield');
$value = $params->get('cronemail-updatefield-value');
if ($params->get('cronemail-updatefield-eval', '0') == '1') {
$value = @eval($value);
}
$field = str_replace('___', '.', $field);
$fabrikDb = $listModel->getDb();
$query = $fabrikDb->getQuery(true);
$query->update($table->db_table_name)->set($field . ' = ' . $fabrikDb->quote($value))->where($table->db_primary_key . ' IN (' . implode(',', $updates) . ')');
$this->log .= "\n update query: {$query}";
$fabrikDb->setQuery($query);
$fabrikDb->execute();
}
$this->log .= "\n updates " . count($updates) . " records";
return count($updates);
}