本文整理汇总了PHP中AdminHelper::echoTemplateOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHelper::echoTemplateOptions方法的具体用法?PHP AdminHelper::echoTemplateOptions怎么用?PHP AdminHelper::echoTemplateOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHelper
的用法示例。
在下文中一共展示了AdminHelper::echoTemplateOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($current_element['user_id'] == $effective_user) {
// handle template change
if (isset($_POST['change_template_id'])) {
if ($_POST['change_template_id'] != $_POST['current_template_id']) {
$new_template_id = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'setelementtemplate', 'element_id' => $request_parameters[0], 'template_id' => $_POST['change_template_id']));
if ($new_template_id) {
if ($_POST['current_template_id'] > 0) {
// delete old custom templates
$cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'deletetemplate', 'template_id' => $_POST['current_template_id']));
}
$cash_admin->page_data['template_id'] = $_POST['change_template_id'];
}
}
}
// deal with templates
$embed_templates = AdminHelper::echoTemplateOptions('embed', $cash_admin->page_data['template_id']);
$cash_admin->page_data['template_options'] = $embed_templates;
if ($cash_admin->page_data['template_id'] >= 0) {
$cash_admin->page_data['custom_template'] = true;
}
$analytics = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getanalytics', 'analtyics_type' => 'elementbasics', 'element_id' => $request_parameters[0], 'user_id' => $cash_admin->effective_user_id));
$cash_admin->page_data['total_views'] = 0;
if (is_array($analytics['payload'])) {
$cash_admin->page_data['total_views'] = CASHSystem::formatCount($analytics['payload']['total']);
$methods_array = array();
$locations_array = array();
foreach ($analytics['payload']['methods'] as $method => $total) {
$methods_string = array('direct', 'api_public', 'api_key', 'api_fullauth');
$methods_translation = array('direct (embedded on this site)', 'api_public (shared to another site)', 'api_key (shared to another site)', 'api_fullauth (another site with your API credentials)');
$methods_array[] = array('access_method' => str_replace($methods_string, $methods_translation, $method), 'total' => $total);
}