function __construct(&$content_obj, $params = array()) { $params['block_type'] = 'dropdown'; parent::__construct($content_obj, $params); $this->SetProperty('delimiter', isset($params['delimiter']) ? $params['delimiter'] : '|'); $this->SetProperty('items', isset($params['items']) ? $params['items'] : ''); $this->SetProperty('values', isset($params['values']) ? $params['values'] : ''); }
function __construct(&$content_obj, $params = array()) { $params['block_type'] = 'multi_input'; parent::__construct($content_obj, $params); $this->SetProperty('inputs', isset($params['inputs']) ? $params['inputs'] : ''); $this->SetProperty('value_delimiter', isset($params['value_delimiter']) ? $params['value_delimiter'] : '<!-- multi_input_value_delimiter -->'); $this->SetProperty('input_delimiter', isset($params['input_delimiter']) ? $params['input_delimiter'] : '<!-- multi_input_delimiter -->'); }
function __construct(&$content_obj, $params = array()) { $params['block_type'] = 'module'; parent::__construct($content_obj, $params); $AC =& ac_utils::get_module('AdvancedContent'); $this->SetProperty('module', isset($params['module']) ? $params['module'] : ''); $this->SetProperty('params', $params, $this->GetProperties()); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'module'; parent::__construct($content_obj, $params); $AdvancedContent =& cms_utils::get_module('AdvancedContent'); $this->SetBlockProperty('module', isset($params['module']) ? $params['module'] : ''); #$this->SetBlockProperty('params',array_diff($params, $this->GetBlockProperties(), $AdvancedContent->GetAllowedParams())); $this->SetBlockProperty('params', $params, $this->GetBlockProperties()); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'image'; parent::__construct($content_obj, $params); $config = cmsms()->GetConfig(); $this->SetBlockProperty('prefix', isset($params['prefix']) ? $params['prefix'] : 'thumb_'); $this->SetBlockProperty('exclude', isset($params['exclude']) && $this->content_obj->IsFalse($params['exclude'])); $this->SetBlockProperty('dir', cms_join_path($config['uploads_path'], isset($params['dir']) ? $params['dir'] : get_site_preference('contentimage_path'))); $this->SetBlockProperty('inputname', isset($params['inputname']) ? $params['inputname'] : $this->GetBlockProperty('id')); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'multi_input'; parent::__construct($content_obj, $params); $AdvancedContent =& cms_utils::get_module('AdvancedContent'); #$AdvancedContent->SetAllowedParam(CLEAN_REGEXP.'/multiInput-.*/',CLEAN_NONE); $this->SetBlockProperty('inputs', isset($params['inputs']) ? $params['inputs'] : ''); $this->SetBlockProperty('value_delimiter', isset($params['value_delimiter']) ? $params['value_delimiter'] : '<!-- multi_input_value_delimiter -->'); $this->SetBlockProperty('input_delimiter', isset($params['input_delimiter']) ? $params['input_delimiter'] : '<!-- multi_input_delimiter -->'); }
public function GetCompiledContent(&$obj) { $config = cmsms()->GetConfig(); $img = ac_utils::CleanURL($config['uploads_url'] . '/' . $this->GetProperty('dir')) . $this->GetContent(); # ToDo: base64 support # get width height automatically from file? if (!$this->GetProperty('urlonly')) { $img = '<img src="' . $img . '" alt="' . $this->GetProperty('alt') . '"' . ($this->GetProperty('title') ? ' title="' . $this->GetProperty('title') . '"' : '') . ($this->GetProperty('class') ? ' class="' . $this->GetProperty('class') . '"' : '') . ($this->GetProperty('css_id') ? ' id="' . $this->GetProperty('id') . '"' : '') . ($this->GetProperty('width') ? ' width="' . $this->GetProperty('width') . '"' : '') . ($this->GetProperty('height') ? ' height="' . $this->GetProperty('height') . '"' : '') . '>'; } $this->SetContent($img); return parent::GetCompiledContent($obj); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'select_multiple'; parent::__construct($content_obj, $params); $AdvancedContent =& cms_utils::get_module('AdvancedContent'); #$AdvancedContent->SetAllowedParam(CLEAN_REGEXP.'/.*_AdvancedContentSortableItem_.*/',CLEAN_STRING); $this->SetBlockProperty('sortable', isset($params['sortable_items']) && $this->content_obj->IsTrue($params['sortable_items'])); # deprecated $this->SetBlockProperty('sortable', isset($params['sortable']) && $this->content_obj->IsTrue($params['sortable'])); $this->SetBlockProperty('delimiter', isset($params['delimiter']) ? $params['delimiter'] : '|'); $this->SetBlockProperty('items', isset($params['items']) ? $params['items'] : ''); $this->SetBlockProperty('values', isset($params['values']) ? $params['values'] : ''); }
function __construct(&$content_obj, $params = array()) { parent::__construct($content_obj, $params); $AC =& ac_utils::get_module('AdvancedContent'); $this->SetProperty('no_collapse', true); $this->SetProperty('collapsible', false); $this->SetProperty('collapse', false); if ($this->content_obj->IsKnownProperty($this->GetProperty('id'))) { $this->SetProperty('error_message', $AC->lang('error_basicattrib', $this->GetProperty('name'))); } else { $this->SetProperty('error_message', $AC->lang('invalid_block', $this->GetProperty('name'), $this->Type())); } $this->SetContent(''); }
function __construct(&$content_obj, $params = array()) { $params['block_type'] = 'text'; parent::__construct($content_obj, $params); $size = isset($params['size']) ? intval($params['size']) : ''; $maxlength = isset($params['maxlength']) ? $params['maxlength'] : ''; $usewysiwyg = (!isset($params['usewysiwyg']) || !ac_utils::IsFalse($params['usewysiwyg'])) && (!isset($params['wysiwyg']) || !ac_utils::IsFalse($params['wysiwyg'])); $rows = isset($params['rows']) ? $params['rows'] : ''; $cols = isset($params['cols']) ? $params['cols'] : ''; $auto_resize = !isset($params['auto_resize']) || !ac_utils::IsFalse($params['auto_resize']); $oneline = isset($params['oneline']) && ac_utils::IsTrue($params['oneline']); $this->SetProperty('size', $size); $this->SetProperty('usewysiwyg', $usewysiwyg); $this->SetProperty('oneline', $oneline); $this->SetProperty('maxlength', $maxlength); $this->SetProperty('rows', $rows); $this->SetProperty('cols', $cols); $this->SetProperty('auto_resize', $auto_resize); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'slider'; parent::__construct($content_obj, $params); $slider_params = array(); if (isset($params['from'])) { $slider_params['from'] = intval($params['from']); } if (isset($params['to'])) { $slider_params['to'] = intval($params['to']); } if (isset($params['step'])) { $slider_params['step'] = intval($params['step']); } if (isset($params['round'])) { $slider_params['round'] = intval($params['round']); } if (isset($params['heterogeneity'])) { $slider_params['heterogeneity'] = $params['heterogeneity']; } if (isset($params['dimension'])) { $slider_params['dimension'] = "'" . $params['dimension'] . "'"; } if (isset($params['limits'])) { $slider_params['limits'] = "'" . $params['limits'] . "'"; } if (isset($params['scale'])) { $slider_params['scale'] = $params['scale']; } if (isset($params['skin'])) { $slider_params['skin'] = "'" . $params['skin'] . "'"; } if (isset($params['calculate'])) { $slider_params['calculate'] = $params['calculate']; } if (isset($params['onstatechange'])) { $slider_params['onstatechange'] = $params['onstatechange']; } if (isset($params['callback'])) { $slider_params['callback'] = $params['callback']; } $this->SetBlockProperty('slider_params', $slider_params); }
function __construct(&$content_obj, &$params = array()) { $size = ''; $usewysiwyg = true; $oneline = false; $maxlength = ''; $rows = ''; $cols = ''; $auto_resize = true; $params['type'] = 'text'; parent::__construct($content_obj, $params); if (isset($params['size'])) { $size = intval($params['size']); } if (isset($params['maxlength'])) { $maxlength = $params['maxlength']; } if ($this->content_obj->GetPropertyValue('disable_wysiwyg') || isset($params['wysiwyg']) && $this->content_obj->IsFalse($params['wysiwyg'])) { $usewysiwyg = false; } if (isset($params['rows'])) { $rows = $params['rows']; } if (isset($params['cols'])) { $cols = $params['cols']; } if (isset($params['auto_resize']) && $this->content_obj->IsFalse('auto_resize')) { $auto_resize = false; } if (isset($params['oneline']) && $this->content_obj->IsTrue($params['oneline'])) { $oneline = true; } $this->SetBlockProperty('size', $size); $this->SetBlockProperty('usewysiwyg', $usewysiwyg); $this->SetBlockProperty('oneline', $oneline); $this->SetBlockProperty('maxlength', $maxlength); $this->SetBlockProperty('rows', $rows); $this->SetBlockProperty('cols', $cols); $this->SetBlockProperty('auto_resize', $auto_resize); }
function __construct(&$content_obj, $params = array()) { $params['block_type'] = 'ui_slider'; parent::__construct($content_obj, $params); $slider_params = array(); if (isset($params['min'])) { $slider_params['min'] = intval($params['min']); } if (isset($params['max'])) { $slider_params['max'] = intval($params['max']); } if (isset($params['orientation'])) { $slider_params['orientation'] = $params['orientation']; } if (isset($params['range'])) { $slider_params['range'] = ac_utils::IsTrue($params['range']) ? true : $params['range']; } if (isset($params['step'])) { $slider_params['step'] = intval($params['step']); } $this->SetProperty('slider_params', $slider_params); $this->SetProperty('unit', isset($params['unit']) ? $params['unit'] : ''); }
public function GetCompiledContent(&$obj) { if ($this->GetProperty('date_format') != '') { $this->SetContent(strftime($this->GetProperty('date_format'), intval($this->GetContent()))); } return parent::GetCompiledContent($obj); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'colorpicker'; parent::__construct($content_obj, $params); }
function __construct(&$content_obj, &$params = array()) { $params['type'] = 'date'; parent::__construct($content_obj, $params); $showClock = !(isset($params['show_clock']) && $this->content_obj->IsFalse($params['show_clock'])); $mode = 'calendar'; if (isset($params['mode']) && strtolower($params['mode']) == 'dropdown') { $mode = 'dropdown'; } $show24h = !(isset($params['show24h']) && $this->content_obj->IsFalse($params['show24h'])); $dateFormat = isset($params['date_format']) ? $params['date_format'] : '%x %X'; $startHour = 0; $endHour = 23; if (isset($params['start_hour'])) { if (endswith($params['start_hour'], 'pm')) { $params['start_hour'] = trim(str_ireplace('pm', '', $params['start_hour'])) + 12; } else { $params['start_hour'] = trim(str_ireplace(array('am', 'pm'), '', $params['start_hour'])); } if ($params['start_hour'] > 0 && $params['start_hour'] <= $endHour) { $startHour = trim($params['start_hour']); } } if (isset($params['end_hour'])) { if (endswith($params['end_hour'], 'pm')) { $params['end_hour'] = trim(str_ireplace('pm', '', $params['end_hour'])) + 12; } else { $params['end_hour'] = trim(str_ireplace(array('am', 'pm'), '', $params['end_hour'])); } if ($params['end_hour'] >= 0 && $params['end_hour'] < $endHour) { $endHour = trim($params['end_hour']); } } if ($endHour < $startHour) { $endHour = $startHour; } $startMinute = 0; if (isset($params['start_minute']) && $params['start_minute'] > 0 && $params['start_minute'] <= 59) { $startMinute = trim($params['start_minute']); } $endMinute = 59; if (isset($params['end_minute']) && $params['end_minute'] >= 0 && $params['end_minute'] < 59) { $endMinute = trim($params['end_minute']); } if ($endMinute < $startMinute) { $endMinute = $startMinute; } $startSecond = 0; if (isset($params['start_second']) && $params['start_second'] > 0 && $params['start_second'] <= 59) { $startSecond = trim($params['start_second']); } $endSecond = 59; if (isset($params['end_second']) && $params['end_second'] >= 0 && $params['end_second'] < 59) { $endSecond = trim($params['end_second']); } if ($endSecond < $startSecond) { $endSecond = $startSecond; } $stepHours = 1; if (isset($params['step_hours']) && $params['step_hours'] > 0 && $params['step_hours'] <= $endHour - $startHour) { $stepHours = trim($params['step_hours']); } else { if (isset($params['step_hours']) && $params['step_hours'] > 0 && $params['step_hours'] >= $endHour - $startHour) { $stepHours = $endHour - $startHour; } } $stepMinutes = 30; if (isset($params['step_minutes']) && $params['step_minutes'] > 0 && $params['step_minutes'] <= $endMinute - $startMinute) { $stepMinutes = trim($params['step_minutes']); } else { if (isset($params['step_minutes']) && $params['step_minutes'] > 0 && $params['step_minutes'] >= $endMinute - $startMinute) { $stepMinutes = $endMinute - $startMinute; } } $stepSeconds = 1; if (isset($params['step_seconds']) && $params['step_seconds'] > 0 && $params['step_seconds'] <= $endSecond - $startSeconds) { $stepSeconds = trim($params['step_seconds']); } else { if (isset($params['step_seconds']) && $params['step_seconds'] > 0 && $params['step_seconds'] >= $endSecond - $startSeconds) { $stepSeconds = $endSecond - $startSeconds; } } $this->SetBlockProperty('show24h', $show24h); $this->SetBlockProperty('mode', $mode); $this->SetBlockProperty('start_hour', $startHour); $this->SetBlockProperty('end_hour', $endHour); $this->SetBlockProperty('start_minute', $startMinute); $this->SetBlockProperty('end_minute', $endMinute); $this->SetBlockProperty('start_second', $startSecond); $this->SetBlockProperty('end_second', $endSecond); $this->SetBlockProperty('step_hours', $stepHours); $this->SetBlockProperty('step_minutes', $stepMinutes); $this->SetBlockProperty('step_seconds', $stepSeconds); $this->SetBlockProperty('show_clock', $showClock); $this->SetBlockProperty('date_format', $dateFormat); }
function __construct(&$content_obj, $params = array()) { $params['block_type'] = 'checkbox'; parent::__construct($content_obj, $params); $this->SetProperty('default', intval($this->GetProperty('default'))); }