3 require_once(
INCLUDE_DIR.
"/htmlpurifier-4.4.0/HTMLPurifier.standalone.php");
15 $config = HTMLPurifier_Config::createDefault();
18 $config->set(
'HTML.SafeIframe',
true);
19 $config->set(
'URI.SafeIframeRegexp',
'%^http://www.youtube.com/embed/%');
21 $config->set(
'HTML.Allowed',
'abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, dl, dt,
22 em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup,
23 u, ul, var,h1 ,h2, h3, h4, h5, h6, span, div,br,
25 img[src|alt|height|width],
26 video[preload|src|height|width|controls|autoplay|loop|poster],
27 iframe[src|width|height],
28 table[border|frame|cellpadding|cellspacing|rules],
30 td[valign|align|scope],
31 th[valign|align|scope],
37 $config->set(
'CSS.AllowedProperties',array(
38 'text-decoration',
'text-align',
'font-family',
'font-size',
39 'padding-left',
'padding-right',
'padding-top',
'padding-bottom',
'padding',
40 'margin-left',
'margin-right',
'margin-top',
'margin-bottom',
'margin',
41 'border-left',
'border-right',
'border-top',
'border-bottom',
'border',
'border-collapse',
'border-color',
'border-style',
42 'color',
'background-color',
'border',
'border-radius',
'box-shadow',
43 'float',
'position',
'width',
'height',
'left',
'top',
'right',
'bottom'
46 $config->set(
'CSS.Trusted',
true);
48 $config->set(
'Attr.AllowedFrameTargets', array(
'_blank'));
51 $config->set(
'HTML.DefinitionID',
'video-custom.html');
52 $config->set(
'HTML.DefinitionRev', 1);
56 if ($def =
$config->maybeGetRawHTMLDefinition() ){
57 $videotag = $def->addElement(
67 'preload' =>
'Enum#auto,metadata,none',
75 $videotag->excludes = array(
'video' =>
true);
80 $purifier =
new HTMLPurifier(
$config);
81 $clean_html = $purifier->purify(
$value);
82 $this->
value = $clean_html;
94 echo
'<script language="javascript" type="text/javascript" src="'.APP_ROOT.
'/JS/tiny_mce/tiny_mce.js"></script>';
95 echo
'<script language="javascript" type="text/javascript">';
98 plugins : "media,layer,table,contextmenu",
99 content_css: "'.APP_ROOT.
'/CSS/tinyMCE.css",
102 theme_advanced_resizing : true,
103 elements : "label_text",
104 theme_advanced_toolbar_location : "top",
105 theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,"
106 + "justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,"
107 + "bullist,numlist,outdent,indent,"
108 + "|,forecolor,backcolor",
109 theme_advanced_buttons2 : "link,unlink,anchor,image,media,separator,"
110 +"undo,redo,cleanup,code,separator,sub,sup,charmap,|,insertlayer,moveforward,movebackward,absolute,",
111 theme_advanced_buttons3 : "tablecontrols",
114 relative_urls : false,
115 remove_script_host : false
118 echo
"<textarea rows='20' cols='100' name='label_text' id='label_text'>{$this->value}</textarea>";
122 if(
sizeof($this->widget_list) != 0 ){
123 echo
"<table class='table_1'>";
124 echo
"<tr><th>ID</th> <th>Name</th> <th>Link zum einbauen</th> <th>Bearbeiten</th></tr>";
125 foreach($this->widget_list as
$widget){
127 echo
"<td>{$widget->ID}</td>";
128 echo
"<td>{$widget->dispName}</td>";
129 echo
"<td><a href='../text.php?pollID={$this->pollID}&widget={$widget->ID}' target='_blank'>text.php?pollID={$this->pollID}&widget={$widget->ID}</td>";
131 <input type='submit' name='editq_option_ID{$widget->ID}' title='Option Bearbeiten' value='' tabindex='-1' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/preferences-system.png );background-repeat:no-repeat;width:26px;height:26px;' />
132 <input type='submit' name='addq_option_ID{$widget->ID}' title='Option Einfügen' value='' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/list-add.png );background-repeat:no-repeat;width:26px;height:26px;' />
133 <input type='submit' name='rmq_option_ID{$widget->ID}' title='Option Löschen' value='' tabindex='-1' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/edit-delete.png );background-repeat:no-repeat;width:26px;height:26px;' />
139 echo
"<input type='submit' name='addq_option_ID{$this->ID}' title='Option Einfügen' value='' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/list-add.png );background-repeat:no-repeat;width:26px;height:26px;' />";
144 if( isset($_POST[
"label_text"]) ){
145 if( !$this->
set_value($_POST[
"label_text"]) ){
146 return "Keinen Text eingetragen.";
149 return "Keinen Text eingetragen.";
155 return $db->update_widget_field($this,
"value",$this->
value);
161 if( (isset($_SESSION[
"last_widget_edit"])) AND ($_SESSION[
"last_widget_edit"] == $this->ID) ){
162 echo
"<script type='text/javascript'>
163 $(document).ready(function(){
164 window.scrollBy(0,-150);
168 $lasted =
" widget_last_edit";
169 unset( $_SESSION[
"last_widget_edit"] );
172 echo
"<div class='widget_container$lasted' style='position:relative;z-index:100;background-color:rgba(255,255,255,0.5)' id='widget_container_{$this->ID}' >";
173 echo
"<div class='widget_edit_toolbar'>";
174 echo
"<a href='edit.php?pollID={$this->pollID}&widgetID={$this->ID}' title='Bearbeiten' ><img src='".APP_ROOT.
"/icons/22/preferences-system.png' alt='edit'/></a>";
175 echo
"<a href='action.widget.php?pollID={$this->pollID}&widgetID={$this->ID}&action=duplicate_widget' title='Kopieren'><img src='".APP_ROOT.
"/icons/22/edit-copy.png' alt='remove'/></a>";
176 echo
"<a href='action.widget.php?pollID={$this->pollID}&widgetID={$this->ID}&action=rmwid' style='margin-left:0px' title='Löschen' ><img src='".APP_ROOT.
"/icons/22/edit-delete.png' alt='remove'/></a>";
177 echo
"<span style='margin-left:7px'> </span>";
178 echo
"<a href='action.widget.php?pollID={$this->pollID}&widgetID={$this->ID}&action=mvup' title='weiter nach Oben schieben'><img src='".APP_ROOT.
"/icons/22/go-up.png' alt='mv up'/></a>";
179 echo
"<a href='action.widget.php?pollID={$this->pollID}&widgetID={$this->ID}&action=mvdwn' title='weiter nach Unten schieben'><img src='".APP_ROOT.
"/icons/22/go-down.png' alt='mv down'/></a>";
181 echo
"<a href='edit.php?pollID={$this->pollID}&widgetID={$this->ID}' class='widget_edit_link' id='widget{$this->ID}'> </a>";
183 echo
"<div style='margin:0px;pading:0px;position:relative;'>{$this->value}</div>";
189 echo
"<div class='label_widget' style='margin:0px;pading:0px;position:relative;'>{$this->value}</div>";