* @var boolean
*/
public $override;
+ /**
+ * Flag to Hide title
+ *
+ * @var boolean
+ */
+ public $hide_title;
+ /**
+ * Flag to Hide widget border
+ *
+ * @var boolean
+ */
+ public $hide_border;
+ /**
+ * Flag to Hide pb caption
+ *
+ * @var boolean
+ */
+ public $hide_pbcap;
/**
* Custom template
*
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Override default template', array('domain' => 'org.civicrm.wci')) ,
'required' => false,
+ ) ,
+ 'hide_title' => array(
+ 'name' => 'hide_title',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('Hide title, if 1.', array('domain' => 'org.civicrm.wci')) ,
+ 'required' => false,
+ ) ,
+ 'hide_border' => array(
+ 'name' => 'hide_border',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('Hide widget border, if 1.', array('domain' => 'org.civicrm.wci')) ,
+ 'required' => false,
+ ) ,
+ 'hide_pbcap' => array(
+ 'name' => 'hide_pbcap',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('Hide pb caption, if 1.', array('domain' => 'org.civicrm.wci')) ,
+ 'required' => false,
) ,
'custom_template' => array(
'name' => 'custom_template',
'color_button_bg' => 'color_button_bg',
'style_rules' => 'style_rules',
'override' => 'override',
+ 'hide_title' => 'hide_title',
+ 'hide_border' => 'hide_border',
+ 'hide_pbcap' => 'hide_pbcap',
'custom_template' => 'custom_template',
);
}
$this->add('select', 'email_signup_group_id', ts('Newsletter signup'), $this->getGroupOptions());
$this->add('select', 'size_variant', ts('Size variant'), $this->getSizeOptions());
// $fieldset = $this->addElement('fieldset')->setLabel('Advanced Settings');
+ $this->add('checkbox', 'hide_title', ts('Hide Title'));
+ $this->add('checkbox', 'hide_border', ts('Hide border'));
+ $this->add('checkbox', 'hide_pbcap', ts('Hide progress bar caption'));
foreach ($this->_colorFields as $name => $val) {
$this->addElement($val[1],
$name,
'style_rules' => base64_decode($wid_page[$dao->id]['style_rules'])));
$this->setDefaults(array(
'override' => $wid_page[$dao->id]['override']));
+ $this->setDefaults(array(
+ 'hide_title' => $wid_page[$dao->id]['hide_title']));
+ $this->setDefaults(array(
+ 'hide_border' => $wid_page[$dao->id]['hide_border']));
+ $this->setDefaults(array(
+ 'hide_pbcap' => $wid_page[$dao->id]['hide_pbcap']));
if(true == $wid_page[$dao->id]['override']) {
$cust_templ = base64_decode($wid_page[$dao->id]['custom_template']);
$this->setDefaults(array(
function postProcess() {
$values = $this->exportValues();
-
$override = 0;
+ $hide_title = 0;
+ $hide_border = 0;
+ $hide_pbcap = 0;
$cust_tmpl = "";
$cust_tmpl_col = "";
$sql = "";
$equals = " = ";
$quote = "'";
}
-
+ if(isset($values['hide_title'])){
+ $hide_title = $values['hide_title'];
+ }
+ if(isset($values['hide_border'])){
+ $hide_border = $values['hide_border'];
+ }
+ if(isset($values['hide_pbcap'])){
+ $hide_pbcap = $values['hide_pbcap'];
+ }
+
if (isset($this->_id)) {
$sql = "UPDATE civicrm_wci_widget SET title = '". base64_encode($values['title'])
. "', logo_image = '" . $values['logo_image'] . "', image = '"
. "', color_description = '" . $values['color_description']
. "', color_border = '" . $values['color_border']
. "', color_button = '" . $values['color_button']
- . "', color_button_bg = '" . $values['color_button_bg']
+ . "', color_button_bg = '" . $values['color_button_bg']
+ . "', hide_title = '" . $hide_title
+ . "', hide_border = '" . $hide_border
+ . "', hide_pbcap = '" . $hide_pbcap
. "', style_rules = '" . base64_encode($values['style_rules']) . "', override = '"
. $override . $quote . $coma . $cust_tmpl_col . $equals . $quote . $cust_tmpl . "' where id =" . $this->_id ;
}
button_title, button_link_to, progress_bar_id, description,
email_signup_group_id, size_variant, color_title, color_title_bg,
color_progress_bar, color_widget_bg, color_description, color_border,
- color_button, color_button_bg, style_rules, override" . $coma . $cust_tmpl_col ." )
+ color_button, color_button_bg, hide_title, hide_border, hide_pbcap, style_rules, override" . $coma . $cust_tmpl_col ." )
VALUES ('" . base64_encode($values['title']) . "','" . $values['logo_image'] . "','" .
$values['image'] . "','" . $values['button_title'] . "','" .
$values['button_link_to'] . "','" . $values['progress_bar'] . "','" .
$values['color_title_bg'] . "','" . $values['color_bar'] . "','" .
$values['color_widget_bg'] . "','" . $values['color_description'] . "','" .
$values['color_border'] . "','" . $values['color_button'] . "','" .
- $values['color_button_bg'] . "','" . base64_encode($values['style_rules']) . "','" .
+ $values['color_button_bg'] . "','" . $values['hide_title'] . "','" .
+ $values['hide_border'] . "','" . $values['hide_pbcap'] . "','"
+ . base64_encode($values['style_rules']) . "','" .
$override . $quote . $coma . $quote . $cust_tmpl
. "')";
}
style_rules text DEFAULT NULL COMMENT 'Additional style rules.',
override tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Override default template, if 1.',
custom_template text DEFAULT NULL COMMENT 'Widget custom template.',
+ hide_title tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Hide title, if 1.',
+ hide_border tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Hide widget border, if 1.',
+ hide_pbcap tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Hide pb caption, if 1.',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_wci_title` (`title`),
CONSTRAINT FK_civicrm_wci_widget_progress_bar_id FOREIGN KEY (`progress_bar_id`) REFERENCES `civicrm_wci_progress_bar`(`id`) ON DELETE SET NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-webkit-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
- border: 4px solid {/literal}{$wciform.color_border}{literal};
+
+ {/literal}{if (0 == $wciform.hide_border)}{literal}
+ border: 4px solid {/literal}{$wciform.color_border}{literal};
+ {if (1 == $wciform.hide_border)}
+ border: None;
+ {/literal}{/if}{literal}
background-color: {/literal}{$wciform.color_widget_bg}{literal}; /* background color */
}
{literal}
</style>
{/literal}
-
<div id="crm_wid_{$wciform.widgetId}" class="crm-wci-widget {$wciform.size_variant}">
- {if $wciform.title}
+ {if $wciform.title && (false == $wciform.hide_title)}
<h5 id="crm_wid_{$wciform.widgetId}_title">
{if $wciform.logo_image}
<span class="crm-logo">
<img id="crm_wci_image" src='{$wciform.image}'/>
</div>
{/if}
+ {if (false == $wciform.hide_pbcap)}
<div class="crm-amounts">
- <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high">${$wciform.goal_amount}</div>
- <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low">${$wciform.starting_amount}</div>
+ <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high">{$wciform.goal_amount}</div>
+ <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low">{$wciform.starting_amount}</div>
<div id="crm_wid_{$wciform.widgetId}_percentage" class="crm-percentage">{$wciform.pb_percentage}%</div>
</div>
+ {/if}
<div class="crm-amount-bar">
<div class="crm-amount-fill" id="crm_wid_{$wciform.widgetId}_amt_fill"></div>
</div>