PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.1.4
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.1.4
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / front / Params / article.php

article.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.1.4, at front/Params/article.php

64 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 include_once __DIR__.DIRECTORY_SEPARATOR.'AcymJFormField.php';
4
5 class JFormFieldArticle extends AcymJFormField
6 {
7 var $type = 'article';
8
9 public function getInput()
10 {
11 $modalId = 'acym_article_'.$this->id;
12 $callback = 'jSelectArticle_'.$this->id;
13
14 $title = '';
15 $value = intval($this->value);
16 if (!empty($value)) {
17 $title = acym_CMSArticleTitle($value);
18 }
19
20 acym_addScript(
21 true,
22 "
23 function $callback(id, title, catid, object, url, language) {
24 window.processModalSelect('Article', '".$this->id."', id, title, catid, object, url, language);
25 toggle_$callback(id);
26 jQuery('#".$modalId."').modal('hide');
27 }
28
29 function toggle_$callback(selection) {
30 if (selection && selection > 0) {
31 jQuery('#button_$modalId').hide();
32 jQuery('#clear_$modalId').show();
33 } else {
34 jQuery('#".$this->id."_name').val('');
35 jQuery('#".$this->id."_id').val('');
36
37 jQuery('#button_$modalId').show();
38 jQuery('#clear_$modalId').hide();
39 }
40 }
41
42 jQuery(function($){
43 toggle_$callback($value);
44 });"
45 );
46
47 $html = '<span class="input-append">';
48 $html .= '<input class="input-medium" id="'.$this->id.'_name" type="text" value="'.acym_escape($title).'" disabled="disabled" size="35" />';
49 $urlSelect = acym_articleSelectionPage().'&function='.$callback;
50 $html .= acym_cmsModal(true, $urlSelect, 'ACYM_SELECT', true, acym_translation('ACYM_SELECT_AN_ARTICLE'), $modalId);
51 $html .= '<a id="clear_'.$modalId.'" class="btn hasTooltip" data-toggle="modal" role="button" onclick="toggle_'.$callback.'(0);">'.acym_translation('ACYM_CLEAR').'</a>';
52 $html .= '</span>';
53
54 $html .= '<input type="hidden" id="'.$this->id.'_id" name="'.$this->name.'" value="'.$value.'" />';
55
56 return $html;
57 }
58
59 public function getLabel()
60 {
61 return str_replace($this->id, $this->id.'_id', parent::getLabel());
62 }
63 }
64