AAAAhome/academiac/www/plugins/content/socialbuttons/fields/bloc.php000060400000023135151373023510021131 0ustar00params = $this->element->attributes() ; $title = $this->def('label') ; $description = $this->def('description') ; $class = $this->def('class') ; $start = $this->def('start',0) ; $end = $this->def('end',0) ; $html = array() ; if (JV == 'j25') { $hastitle = ($title || $description) ; $document=JFactory::getDocument() ; $document->addStylesheet(JURI::root().'plugins/content/socialbuttons/fields/style25.css') ; $html = array() ; if ($start || !$end) { $html[] = $this->getTitleBlock($title, $description, $start) ; if ($start || !$hastitle) { $html[] = '
' ; } if ($start) { $html[] = '' ; } if ($end || !$hastitle) { $html[] = '
' ; $html[] = '
' ; } } $html = implode('', $html) ; } else {if($start || !$end){$html[]='' ; if(!(strpos($class,'alert')===false)){$html[]='
' ; }else{$html[]='
' ; }if($title){$html[]='

'.$title.'

' ; }if($description){$html[]='
'.$description.'
' ; }$html[]='
' ; }if(!$start && !$end){$html[]='
' ; }$html = '
'.implode('',$html) ; }return $html ; } private function getTitleBlock($title = '', $description = '', $start = 0) { $nostyle = $this->def('nostyle', 0) ; if ($description) { $v1 = JText::_($this->def('var1')) ; $v2 = JText::_($this->def('var2')) ; $v3 = JText::_($this->def('var3')) ; $v4 = JText::_($this->def('var4')) ; $v5 = JText::_($this->def('var5')) ; $description = trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)) ; $description = str_replace('span style="font-family:monospace ; "', 'span class="a_code"', $description) ; } $html = array() ; if ($title) { if ($nostyle) { $html[] = '
' ; } else { $class = 'a_panel a_panel_title' ; if ($start || $description) { $class .= ' a_panel_top' ; } $html[] = '
' ; } $html[] = $title ; $html[] = '
' ; $html[] = '
' ; } if ($description) { if ($nostyle) { $html[] = '
' ; } else { $class = 'a_panel a_panel_description' ; if ($start) { $class .= ' a_panel_top' ; } if ($title) { $class .= ' a_panel_hastitle' ; } $html[] = '
' ; } $html[] = $description ; $html[] = '
' ; $html[] = '
' ; } return implode('', $html) ; } private function def($val, $default = '') { return (isset($this->params[$val]) && (string) $this->params[$val] != '') ? (string) $this->params[$val] : $default ; } }class AText{public static function dateToDateFormat ($dateFormat){$caracs=array('%d'=>'d','%a'=>'D','%#d'=>'j','%A'=>'l','%u'=>'N','%w'=>'w','%j'=>'z','%V'=>'W','%B'=>'F','%m'=>'m','%b'=>'M','%G'=>'o','%Y'=>'Y','%y'=>'y','%P'=>'a','%p'=>'A','%l'=>'g','%I'=>'h','%H'=>'H','%M'=>'i','%S'=>'s','%z'=>'O','%Z'=>'T','%s'=>'U') ; return strtr((string) $dateFormat,$caracs) ; }public static function dateToStrftimeFormat($dateFormat){$caracs=array('d'=>'%d','D'=>'%a','jS'=>'%#d[TH]','j'=>'%#d','l'=>'%A','N'=>'%u','w'=>'%w','z'=>'%j','W'=>'%V','F'=>'%B','m'=>'%m','M'=>'%b','o'=>'%G','Y'=>'%Y','y'=>'%y','a'=>'%P','A'=>'%p','g'=>'%l','h'=>'%I','H'=>'%H','i'=>'%M','s'=>'%S','O'=>'%z','T'=>'%Z','U'=>'%s') ; return strtr((string) $dateFormat,$caracs) ; }public static function html_entity_decoder($given_html,$quote_style=ENT_QUOTES,$charset='UTF-8'){if(is_array($given_html)){foreach ($given_html as $i=>$html){$given_html[$i]=self::html_entity_decoder($html) ; }return $given_html ; }return html_entity_decode($given_html,$quote_style,$charset) ; }public static function cleanTitle($str,$striptags=0){$str=preg_replace('#<\!--.*?-->#s','',$str) ; if($striptags){$str=preg_replace('#]*>#usi','',$str) ; }return trim($str) ; }public static function prepareSelectItem($str,$published=1,$type='',$remove_first=0){$str=str_replace(array('  ; ','  ; '),' ',$str) ; $str=preg_replace('#- #',' ',$str) ; for ($i=0 ; $remove_first > $i ; $i++){$str=preg_replace('#^ #','',$str) ; }preg_match('#^( *)(.*)$#',$str,$match) ; list($str,$pre,$name)=$match ; $pre = preg_replace('# #', ' · ', $pre) ; $pre = preg_replace('#(( · )*) · #', '\1 » ', $pre) ; $pre = str_replace(' ', '  ; ', $pre) ; if ($type=='separator'){$pre='[[:font-weight:normal ; font-style:italic ; color:grey ; :]]'.$pre ; }else if (!$published){$pre='[[:font-style:italic ; color:grey ; :]]'.$pre ; $name=$name.' ['.JText::_('JUNPUBLISHED').']' ; }else if($published==2){$pre='[[:font-style:italic ; :]]'.$pre ; $name=$name.' ['.JText::_('JARCHIVED').']' ; }return $pre.$name ; }public static function strReplaceOnce($s,$r,$str){$r=str_replace(array('\\','$'),array('\\\\','\\$'),$r) ; return preg_replace('#'.preg_quote($s,'#').'#',$r,$str,1) ; }}class JFormFieldA_Color extends JFormField{public $type='Color' ; protected function getInput(){$field=new aFieldColor ; return $field->getInput($this->name, $this->id, $this->value, $this->element->attributes()) ; }}class aFieldColor{function getInput($name,$id,$value,$params){$this->name=$name ; $this->id=$id ; $this->value=$value ; $this->params=$params ; $class=trim('a_color acolors '.$this->def('class')) ; $disabled=$this->def('disabled')?' disabled="disabled"':'' ; $document=JFactory::getDocument() ; $document->addStylesheet(JURI::root().'plugins/content/socialbuttons/fields/color3.css') ; $document->addScript(JURI::root().'plugins/content/socialbuttons/fields/color3.js') ; $this->value=strtoupper(preg_replace('#[^a-z0-9]#si','',$this->value)) ; return'' ; }private function def($val,$default=''){return(isset($this->params[$val])&&(string)$this->params[$val]!='')?(string)$this->params[$val]:$default ; }}class JFormFieldA_Slide extends JFormField { public $type = 'Slide' ; protected function getLabel() { return '' ; } protected function getInput() {$field = new aFieldSlide ; return $field->getInput($this->element->attributes()) ; } } class aFieldSlide { function getInput($params) {$this->params = $params ; $option = JFactory::getApplication()->input->get('option') ; $param = $this->def('param') ; $value = $this->def('value') ; $nofx = $this->def('nofx') ; $horz = $this->def('horizontal') ; $method = $this->def('method') ; $div = $this->def('div', 0) ; if (JV == 'j25') {JHtml::_('behavior.mootools') ; $document=JFactory::getDocument() ; $document->addStylesheet(JURI::root().'plugins/content/socialbuttons/fields/style25.css') ; $document->addScript(JURI::root().'plugins/content/socialbuttons/fields/script25.js') ; $document->addScript(JURI::root().'plugins/content/socialbuttons/fields/slide25.js') ; $param = preg_replace('#^\s*(.*?)\s*$#', '\1', $param) ; $param = preg_replace('#\s*\|\s*#', '|', $param) ; $html = array() ; if ($param != '') { $param = preg_replace('#[^a-z0-9-\.\|\@]#', '_', $param) ; $param = str_replace('@', '_', $param) ; $set_groups = explode('|', $param) ; $set_values = explode('|', $value) ; $ids = array() ; foreach ($set_groups as $i => $group) { $count = $i ; if ($count >= count($set_values)) {$count = 0 ; } $value = explode(',', $set_values[$count]) ; foreach ($value as $val) { $ids[] = $group . '.' . $val ; } } if (!$div) {$html[] = '
  • ' ; } $html[] = '
    ' ; if (!$div) {$html[] = '
    • ' ; } } else { if (!$div) { $html[] = "\n" . '
    ' ; $html[] = '
    ' ; } $html[] = '
    ' ; } } else { $document=JFactory::getDocument() ; $document->addScript(JURI::root().'plugins/content/socialbuttons/fields/script3.js') ; $document->addScript(JURI::root().'plugins/content/socialbuttons/fields/slide3.js') ; $param=preg_replace('#^\s*(.*?)\s*$#','\1',$param) ; $param=preg_replace('#\s*\|\s*#','|',$param) ; $html=array() ; if($param != ''){$param=preg_replace('#[^a-z0-9-\.\|\@]#','_',$param) ; $param=str_replace('@','_',$param) ; $set_groups=explode('|',$param) ; $set_values=explode('|',$value) ; $ids=array() ; foreach($set_groups as $i => $group){$count=$i ; if($count >= count($set_values)){$count=0 ; }$value=explode(',',$set_values[$count]) ; foreach($value as $val){$ids[]=$group.'.'.$val ; }}if(!$div){$html[]='
  • ' ; }$html[]='
    ' ; if(!$div){$html[]='
    ' ; }}else{$html[]='
    ' ; }}return implode('', $html) ; } private function def($val, $default = '') { return (isset($this->params[$val]) && (string) $this->params[$val] != '') ? (string) $this->params[$val] : $default ; } }