Lines Matching refs:this

256 	$this->settings['remove_bslash'] = true;
257 $this->settings['compress_colors'] = true;
258 $this->settings['compress_font-weight'] = true;
259 $this->settings['lowercase_s'] = false;
260 $this->settings['optimise_shorthands'] = 1;
261 $this->settings['remove_last_;'] = false;
262 $this->settings['case_properties'] = 1;
263 $this->settings['sort_properties'] = false;
264 $this->settings['sort_selectors'] = false;
265 $this->settings['merge_selectors'] = 2;
266 $this->settings['discard_invalid_properties'] = false;
267 $this->settings['css_level'] = 'CSS2.1';
268 $this->settings['preserve_css'] = false;
269 $this->settings['timestamp'] = false;
271 $this->load_template('default');
272 $this->print = new csstidy_print($this);
273 $this->optimise = new csstidy_optimise($this);
285 if(isset($this->settings[$setting]))
287 return $this->settings[$setting];
302 if(isset($this->settings[$setting]) && $value !== '')
304 $this->settings[$setting] = $value;
319 if($this->get_cfg('preserve_css') || $do) {
320 $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
336 $line = $this->line;
340 if(!isset($this->log[$line]) || !in_array($add,$this->log[$line]))
342 $this->log[$line][] = $add;
373 …$this->log('Replaced unicode notation: Changed \\'. $add .' to ' . chr(hexdec($add)),'Information'…
386 if($add != '\\' || !$this->get_cfg('remove_bslash') || strpos($tokens, $string{$i+1}) !== false) {
391 $this->log('Removed unnecessary backslash','Information');
409 $this->template = $predefined_templates[$content];
422 $this->template[$i] = $template[$i];
434 return $this->parse(@file_get_contents($url));
460 $this->print = new csstidy_print($this);
461 $this->optimise = new csstidy_optimise($this);
466 $this->css = array();
467 $this->print->input_css = $string;
475 ++$this->line;
478 switch($this->status)
486 $this->status = 'ic'; ++$i;
487 $this->from = 'at';
491 $this->status = 'is';
492 $this->_add_token(AT_START, $this->at);
496 $this->at = trim($this->at).',';
500 $this->at .= $this->_unicode($string,$i);
505 $lastpos = strlen($this->at)-1;
506 …if(!( (ctype_space($this->at{$lastpos}) || csstidy::is_token($this->at,$lastpos) && $this->at{$las…
508 $this->at .= $string{$i};
517 if($string{$i} == '/' && @$string{$i+1} == '*' && trim($this->selector) == '')
519 $this->status = 'ic'; ++$i;
520 $this->from = 'is';
522 elseif($string{$i} == '@' && trim($this->selector) == '')
525 $this->invalid_at = true;
530 ($type == 'at') ? $this->at = '@'.$name : $this->selector = '@'.$name;
531 $this->status = $type;
533 $this->invalid_at = false;
537 if($this->invalid_at)
539 $this->selector = '@';
549 $this->log('Invalid @-rule: '.$invalid_at_name.' (removed)','Warning');
554 $this->selector .= $string{$i};
555 $this->status = 'instr';
556 $this->str_char = $string{$i};
557 $this->from = 'is';
559 elseif($this->invalid_at && $string{$i} == ';')
561 $this->invalid_at = false;
562 $this->status = 'is';
566 $this->status = 'ip';
567 $this->_add_token(SEL_START, $this->selector);
568 $this->added = false;
572 $this->_add_token(AT_END, $this->at);
573 $this->at = '';
574 $this->selector = '';
575 $this->sel_separate = array();
579 $this->selector = trim($this->selector).',';
580 $this->sel_separate[] = strlen($this->selector);
584 $this->selector .= $this->_unicode($string,$i);
586 else $this->selector .= $string{$i};
590 $lastpos = strlen($this->selector)-1;
591 …($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || csstidy::is_token($this->selector…
593 $this->selector .= $string{$i};
602 if(($string{$i} == ':' || $string{$i} == '=') && $this->property != '')
604 $this->status = 'iv';
605 … if(csstidy::property_is_valid($this->property) || !$this->get_cfg('discard_invalid_properties')) {
606 $this->_add_token(PROPERTY, $this->property);
609 elseif($string{$i} == '/' && @$string{$i+1} == '*' && $this->property == '')
611 $this->status = 'ic'; ++$i;
612 $this->from = 'ip';
616 $this->explode_selectors();
617 $this->status = 'is';
618 $this->invalid_at = false;
619 $this->_add_token(SEL_END, $this->selector);
620 $this->selector = '';
621 $this->property = '';
625 $this->property = '';
629 $this->property .= $this->_unicode($string,$i);
634 $this->property .= $string{$i};
640 …$pn = (($string{$i} == "\n" || $string{$i} == "\r") && $this->property_is_next($string,$i+1) || $i…
645 $this->status = 'ic'; ++$i;
646 $this->from = 'iv';
650 $this->sub_value .= $string{$i};
651 $this->str_char = ($string{$i} == '(') ? ')' : $string{$i};
652 $this->status = 'instr';
653 $this->from = 'iv';
657 $this->sub_value = trim($this->sub_value).',';
661 $this->sub_value .= $this->_unicode($string,$i);
665 …if($this->selector{0} == '@' && isset($at_rules[substr($this->selector,1)]) && $at_rules[substr($t…
667 $this->sub_value_arr[] = trim($this->sub_value);
669 $this->status = 'is';
671 switch($this->selector)
673 case '@charset': $this->charset = $this->sub_value_arr[0]; break;
674 … case '@namespace': $this->namespace = implode(' ',$this->sub_value_arr); break;
675 … case '@import': $this->import[] = implode(' ',$this->sub_value_arr); break;
678 $this->sub_value_arr = array();
679 $this->sub_value = '';
680 $this->selector = '';
681 $this->sel_separate = array();
685 $this->status = 'ip';
690 $this->sub_value .= $string{$i};
692 if(($string{$i} == '}' || $string{$i} == ';' || $pn) && !empty($this->selector))
694 if($this->at == '')
696 $this->at = DEFAULT_AT;
700 if($this->get_cfg('lowercase_s'))
702 $this->selector = strtolower($this->selector);
704 $this->property = strtolower($this->property);
706 $this->optimise->subvalue();
707 if($this->sub_value != '') {
708 $this->sub_value_arr[] = $this->sub_value;
709 $this->sub_value = '';
712 $this->value = implode(' ',$this->sub_value_arr);
714 $this->selector = trim($this->selector);
716 $this->optimise->value();
718 $valid = csstidy::property_is_valid($this->property);
719 …if((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_pro…
721 … $this->css_add_property($this->at,$this->selector,$this->property,$this->value);
722 $this->_add_token(VALUE, $this->value);
723 $this->optimise->shorthands();
727 if($this->get_cfg('discard_invalid_properties'))
729 $this->log('Removed invalid property: '.$this->property,'Warning');
733 …$this->log('Invalid property in '.strtoupper($this->get_cfg('css_level')).': '.$this->property,'Wa…
737 $this->property = '';
738 $this->sub_value_arr = array();
739 $this->value = '';
743 $this->explode_selectors();
744 $this->_add_token(SEL_END, $this->selector);
745 $this->status = 'is';
746 $this->invalid_at = false;
747 $this->selector = '';
752 $this->sub_value .= $string{$i};
756 $this->optimise->subvalue();
757 if($this->sub_value != '') {
758 $this->sub_value_arr[] = $this->sub_value;
759 $this->sub_value = '';
767 …if($this->str_char == ')' && $string{$i} == '"' && !$this->str_in_str && !csstidy::escaped($string…
769 $this->str_in_str = true;
771 …elseif($this->str_char == ')' && $string{$i} == '"' && $this->str_in_str && !csstidy::escaped($str…
773 $this->str_in_str = false;
775 … if($string{$i} == $this->str_char && !csstidy::escaped($string,$i) && !$this->str_in_str)
777 $this->status = $this->from;
784 $this->log('Fixed incorrect newline in string','Warning');
786 if($this->from == 'iv')
788 $this->sub_value .= $temp_add;
790 elseif($this->from == 'is')
792 $this->selector .= $temp_add;
800 $this->status = $this->from;
802 $this->_add_token(COMMENT, $cur_comment);
813 $this->optimise->postparse();
815 $this->print->_reset();
817 …return !(empty($this->css) && empty($this->import) && empty($this->charset) && empty($this->tokens…
828 if($this->get_cfg('merge_selectors') == 1)
832 $this->sel_separate[] = strlen($this->selector);
833 foreach($this->sel_separate as $num => $pos)
835 if($num == count($this->sel_separate)-1) {
839 $new_sels[] = substr($this->selector,$lastpos,$pos-$lastpos-1);
847 $this->merge_css_blocks($this->at,$selector,$this->css[$this->at][$this->selector]);
849 unset($this->css[$this->at][$this->selector]);
852 $this->sel_separate = array();
879 if($this->get_cfg('preserve_css') || trim($new_val) == '') {
883 $this->added = true;
884 if(isset($this->css[$media][$selector][$property]))
886 …sstidy::is_important($this->css[$media][$selector][$property]) && csstidy::is_important($new_val))…
888 unset($this->css[$media][$selector][$property]);
889 $this->css[$media][$selector][$property] = trim($new_val);
894 $this->css[$media][$selector][$property] = trim($new_val);
910 $this->css_add_property($media,$selector,$property,$value,false);
967 $this->log('Added semicolon to the end of declaration','Warning');
982 …return (isset($all_properties[$property]) && strpos($all_properties[$property],strtoupper($this->g…