$val) { if(in_array($key, array('body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right'))) continue; $args->{$key} = utf8RawUrlDecode(utf8RawUrlDecode($val)); } } /** * 위젯이 widgetContent/ widgetBox가 아니라면 내용을 구함 **/ if($widget != 'widgetContent' && $widget != 'widgetBox') { if(!is_dir(sprintf('./widgets/%s/',$widget))) return; // 위젯의 내용을 담을 변수 $widget_content = ''; // 캐시된 코드가 있는지 확인 $widget_sequence = $args->widget_sequence; $widget_cache = $args->widget_cache; if($widget_cache && $widget_sequence) $widget_content = WidgetHandler::getCache($widget_sequence, $widget_cache); // 캐시된 코드가 없을 경우 코드 생성 if(!$widget_content) { $oWidget = WidgetHandler::getObject($widget); if(!$oWidget) return; $widget_content = $oWidget->proc($args); if(is_object($widget_content) && (is_a($widget_content, 'Object')||is_subclass_of($widget_content, 'Object'))) $widget_content = $widget_content->getMessage(); } // 위젯의 캐시값과 위젯 sequence가 있을 경우 캐시 파일에 저장 if($widget_cache && $widget_sequence) WidgetHandler::writeCache($widget_sequence, $widget_content); } /** * 관리자가 지정한 위젯의 style을 구함 **/ // 가끔 잘못된 코드인 background-image:url(none)이 들어 있을 수가 있는데 이럴 경우 none에 대한 url을 요청하므로 무조건 제거함 $style = preg_replace('/background\-image: url\(none\)/is','', $args->style); // 내부 여백을 둔 것을 구해서 style문으로 미리 변경해 놓음 $widget_padding_left = $args->widget_padding_left; $widget_padding_right = $args->widget_padding_right; $widget_padding_top = $args->widget_padding_top; $widget_padding_bottom = $args->widget_padding_bottom; $inner_style = sprintf("padding:%dpx %dpx %dpx %dpx !important; padding:none !important;", $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left); /** * 위젯 출력물을 구함 **/ // 일반 페이지 호출일 경우 지정된 스타일만 꾸면서 바로 return 함 if(!$include_info) { switch($widget) { // 내용 직접 추가일 경우 case 'widgetContent' : $body = base64_decode($args->body); $output = sprintf('
', $style, $inner_style, $body); break; // 위젯 박스일 경우 case 'widgetBox' : $output = sprintf('