72 if (isset(
$_GET[
'widgetID']))
75 $this->
id =
$_GET[
'widgetID'];
77 $this->data = array();
80 $res =
$db->query(
"SELECT property, value FROM {widget_settings}
81 WHERE widgetID = '".$this->
id.
"'
82 AND activated = '1'");
84 while($row = mysqli_fetch_assoc(
$res))
86 $this->data[$row[
'property']] = $row[
'value'];
90 if (is_array($this->data))
96 echo
"Error: this data object is empty - unable to load widget settings of widget ID: ".$this->id.
"";
130 if (
$res =
$db->query(
"SELECT * FROM {widget_settings} WHERE widgetID = '".$widgetID.
"' ORDER by sortation"))
132 $settingsArray = array();
133 while ($row =
$res->fetch_assoc())
135 $settingsArray[] = $row;
140 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get widget settings array of widget ID $widgetID", 0, 0, 0, 0);
144 return $settingsArray;
153 public static function getWidgetFormElements(
$db,
$settings, $widgetID, $widgetFolder,
$lang)
157 if(!isset($widgetID) && (empty($widgetID)))
159 die (
"Could not get widget settings because widget ID is missing.");
168 if (!isset($language) || (!isset(
$lang)))
171 if (is_dir(
'../system/widgets/'.$widgetFolder.
'/language/'))
179 if (!isset($setting[
'fieldType']) || (empty($setting[
'fieldType'])))
181 $setting[
'fieldType'] =
"input";
184 if ($setting[
'widgetID'] ===
"$widgetID" && ($setting[
'activated'] ===
"1"))
188 if (isset($setting[
'icon']) && (!empty($setting[
'icon'])))
190 $setting[
'icon'] =
"<i class=\"$setting[icon]\"></i>";
194 $setting[
'icon'] =
'';
199 if (isset($setting[
'label']) && (!empty($setting[
'label'])))
201 $setting[
'label'] =
$lang[$setting[
'label']];
205 $setting[
'label'] =
"$setting[property]";
210 if (isset($setting[
'heading']) && (!empty($setting[
'heading'])))
212 $setting[
'heading'] =
$lang[$setting[
'heading']];
216 $setting[
'heading'] =
'';
221 if (isset($setting[
'subtext']) && (!empty($setting[
'subtext'])))
223 $setting[
'subtext'] =
$lang[$setting[
'subtext']];
227 $setting[
'subtext'] =
'';
232 if (isset($setting[
'description']) && (!empty($setting[
'description'])))
234 $setting[
'description'] =
$lang[$setting[
'description']];
235 $setting[
'description'] =
" <small><i class=\"fa fa-question-circle-o text-info\" data-placement=\"auto right\" data-toggle=\"tooltip\" title=\"$setting[description]\"></i></small>";
239 if ($setting[
'fieldType'] ===
"checkbox")
241 if ($setting[
'value'] ===
"1" or ($setting[
'value'] ===
"true"))
243 $checked =
"checked";
249 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
251 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
253 echo
"<input type=\"hidden\" name=\"$setting[property]\" value=\"0\">
254 <input type=\"checkbox\" id=\"$setting[property]\" name=\"$setting[property]\" value=\"1\" $checked>
255 <label for=\"$setting[property]\"> $setting[label] $setting[description]</label><br>";
259 if ($setting[
'fieldType'] ===
"radio")
261 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
262 <input type=\"radio\" id=\"$setting[property]\" name=\"$setting[property]\">";
263 echo
"<input type=\"radio\" value=\"$setting[value]\">$lang[SETTING_CURRENT] $setting[value]</option>";
265 $optionValues = explode(
":", $setting[
'options']);
266 foreach ($optionValues as
$value)
269 $optionValue = preg_replace(
"/,[a-zA-Z0-9]*/",
"",
$value);
271 $optionDesc = preg_replace(
'/.*,(.*)/',
'$1',
$value);
273 echo
"<option value=\"$optionValue\">$optionDesc</option>";
279 if ($setting[
'fieldType'] ===
"select")
281 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
283 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
286 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
287 <select class=\"form-control\" id=\"$setting[property]\" name=\"$setting[property]\">";
288 echo
"<option value=\"$setting[value]\">$lang[SETTING_CURRENT] $setting[value]</option>";
290 $optionValues = explode(
":", $setting[
'options']);
291 foreach ($optionValues as
$value)
294 $optionDesc = preg_replace(
'/.*,(.*)/',
'$1',
$value);
296 $optionValue = preg_split(
"/,[a-zA-Z0-9]*/",
$value);
298 echo
"<option value=\"$optionValue[0]\">$optionDesc</option>";
304 if ($setting[
'fieldType'] ===
"textarea")
306 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
308 echo
"<h3>$setting[icon] $setting[heading] $setting[subtext]</h3>";
310 $placeholder = $setting[
'placeholder'];
311 if (isset($setting[
'longValue']) && (!empty($setting[
'longValue'])))
313 $setting[
'longValue'] = nl2br($setting[
'longValue']);
314 echo
"<label for=\"$setting[property]-long\">$setting[label] $setting[description]</label>
315 <textarea cols=\"64\" rows=\"10\" placeholder=\"$lang[$placeholder]\" class=\"$setting[fieldClass]\" id=\"$setting[property]-long\" name=\"$setting[property]-long\">$setting[longValue]</textarea>";
319 $placeholder = $setting[
'placeholder'];
320 $setting[
'value'] = nl2br($setting[
'value']);
321 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
322 <textarea cols=\"64\" rows=\"10\" placeholder=\"$lang[$placeholder]\" class=\"$setting[fieldClass]\" id=\"$setting[property]\" name=\"$setting[property]\">$setting[value]</textarea>";
327 if ($setting[
'fieldType'] ===
"password")
329 $placeholder = $setting[
'placeholder'];
330 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
332 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
334 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
335 <input type=\"password\" class=\"$setting[fieldClass]\" id=\"$setting[property]\" name=\"$setting[property]\"
336 value=\"$setting[value]\" placeholder=\"$lang[$placeholder]\"><p>$setting[description]</p>";
340 if ($setting[
'fieldType'] ===
"input")
342 $placeholder = $setting[
'placeholder'];
344 if (isset(
$lang[$placeholder]))
346 $placeholder =
$lang[$placeholder];
353 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
355 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
358 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
359 <input type=\"text\" class=\"$setting[fieldClass]\" id=\"$setting[property]\"
360 name=\"$setting[property]\" value=\"$setting[value]\" placeholder=\"$placeholder\">";
364 if ($setting[
'fieldType'] ===
"color")
366 $placeholder = $setting[
'placeholder'];
367 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
369 echo
"<h3>$setting[icon] $setting[heading] $setting[subtext]</h3>";
371 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
372 <input type=\"text\" class=\"form-control $setting[fieldType]\" id=\"$setting[property]\" name=\"$setting[property]\"
373 value=\"$setting[value]\" placeholder=\"$lang[$placeholder]\">";
377 if ($setting[
'fieldType'] ===
"editor")
379 require_once (
'editor.php');
384 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
386 echo
"<h3>$setting[icon] $setting[heading] $setting[subtext]</h3>";
389 if (isset($setting[
'longValue']) && (!empty($setting[
'longValue'])))
391 echo
"<label for=\"$setting[property]-long\">$setting[label] $setting[description]</label>
392 <textarea cols=\"64\" rows=\"10\" class=\"$setting[fieldClass]\" id=\"$setting[property]-long\" name=\"$setting[property]-long\">$setting[longValue]</textarea>";
396 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
397 <textarea cols=\"64\" rows=\"10\" class=\"$setting[fieldClass]\" id=\"$setting[property]\" name=\"$setting[property]\">$setting[value]</textarea>";
403 if ($setting[
'fieldType'] ===
"submenuSelector"){
405 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
407 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
410 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
411 <select class=\"$setting[fieldClass]\" id=\"$setting[property]\" name=\"$setting[property]\">";
413 $res =
$db->query(
"SELECT * FROM {menu_names} ORDER BY name ASC");
417 while ($row = mysqli_fetch_array(
$res))
419 echo
"<option value=\"$row[id]\" ";
420 if ($setting[
'value'] === $row[
'id'])
424 echo
">$row[name]</option>";
429 echo
"<option value=\"0\">$lang[NONE_SELECTED]</option>";
439 if ($setting[
'fieldType'] ===
"selectGallery")
442 $requiredAssets = array(
'Lightbox 2 JS' =>
'js',
'Lightbox 2 CSS' =>
'css');
447 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
449 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
452 echo
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>
453 <select class=\"form-control\" id=\"$setting[property]\" name=\"$setting[property]\">";
454 echo
"<option value=\"$setting[value]\">$lang[SETTING_CURRENT] $setting[value]</option>";
457 if (
$res =
$db->query(
"SELECT id, title FROM {plugin_gallery}"))
459 while ($row = mysqli_fetch_array(
$res))
461 if ($setting[
'value'] === $row[0])
463 $selected =
"selected";
470 echo
"<option value=\"$row[0]\"$selected>$row[1]</option>";
472 echo
"<option value=\"\">$lang[NONE_SELECTED]</option>";
479 if ($setting[
'fieldType'] ===
"fbGallerySelect")
481 if (!empty($setting[
'icon']) || (!empty($setting[
'heading']) || (!empty($setting[
'subtext']))))
483 echo
"<h3>$setting[icon] $setting[heading] <small>$setting[subtext]</small></h3>";
490 if (isset($appId) && (is_string($appId) && (!empty($appId)
491 && (isset($token) && (is_string($token) && (!empty($token)))))))
495 $json_link =
"https://graph.facebook.com/v3.3/me/albums?access_token={$token}";
502 curl_setopt($curl, CURLOPT_URL, $json_link);
503 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
504 $apiObject = json_decode(curl_exec($curl),
true, 512, JSON_BIGINT_AS_STRING);
511 $fbGallerySelectMarkup =
'';
513 if (isset($apiObject) && (is_array($apiObject[
'data']) && (!empty($apiObject[
'data']))))
516 $fbGallerySelectMarkup =
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>";
517 $fbGallerySelectMarkup .=
"<select class=\"form-control\" id=\"$setting[property]\" name=\"$setting[property]\">";
524 $selected =
" selected";
526 else { $selected =
''; }
528 $fbGallerySelectMarkup .=
"<option value=\"$field[id]\"$selected>$field[name]</option>";
531 $fbGallerySelectMarkup .=
"</select>";
535 $fbGallerySelectMarkup =
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>";
536 $fbGallerySelectMarkup .=
"<input type=\"text\" class=\"form-control\" placeholder=\"$lang[PH_FB_GALLERY_ALBUMID]\" name=\"$setting[property]\" value=\"$setting[value]\">";
542 $fbGallerySelectMarkup =
"<label for=\"$setting[property]\">$setting[label] $setting[description]</label>";
543 $fbGallerySelectMarkup .=
"<input type=\"text\" class=\"form-control\" placeholder=\"$lang[PH_FB_GALLERY_ALBUMID]\" name=\"$setting[property]\" value=\"$setting[value]\">";
547 echo $fbGallerySelectMarkup;
566 if ($res_widgets =
$db->query(
"SELECT MAX(id), MAX(sort) FROM {widgets}")) {
568 if ($row = mysqli_fetch_row($res_widgets))
577 \YAWK\sys::setSyslog(
$db, 39, 1,
"could not get max ID.", 0, 0, 0, 0);
582 if ($res_widgets =
$db->query(
"INSERT INTO {widgets}
583 (id, published, widgetType, pageID, sort, position)
584 VALUES('" .
$id .
"',
592 if ($res_defaults =
$db->query(
"SELECT * FROM {widget_defaults}
594 AND activated = '1'"))
596 while ($row = mysqli_fetch_assoc($res_defaults))
598 $w_property = $row[
'property'];
599 $w_value = $row[
'value'];
600 $w_widgetType = $row[
'widgetType'];
601 $w_activated = $row[
'activated'];
602 $w_sortation = $row[
'sortation'];
603 $w_label = $row[
'label'];
604 $w_icon = $row[
'icon'];
605 $w_heading = $row[
'heading'];
606 $w_subtext = $row[
'subtext'];
607 $w_fieldClass = $row[
'fieldClass'];
608 $w_fieldType = $row[
'fieldType'];
609 $w_placeholder = $row[
'placeholder'];
610 $w_options = $row[
'options'];
611 $w_description = $row[
'description'];
614 if (
$db->query(
"INSERT INTO {widget_settings}
615 (widgetID, property, value, widgetType, activated, sortation, label, icon, heading, subtext, fieldClass, fieldType, placeholder, options, description)
616 VALUES('" .
$id .
"',
617 '" . $w_property .
"',
619 '" . $w_widgetType .
"',
620 '" . $w_activated .
"',
621 '" . $w_sortation .
"',
624 '" . $w_heading .
"',
625 '" . $w_subtext .
"',
626 '" . $w_fieldClass .
"',
627 '" . $w_fieldType .
"',
628 '" . $w_placeholder .
"',
629 '" . $w_options .
"',
630 '" . $w_description .
"')"))
636 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to insert settings of widget :$id property:$w_property value: $w_value type: $w_widgetType active: $w_activated", 0, 0, 0, 0);
643 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to set widget defaults of widget ID <b>$id</b>.", 0, 0, 0, 0);
649 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to add new widget", 0, 0, 0, 0);
655 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get MAX(id) of widgets db", 0, 0, 0, 0);
677 $subtext =
"<small>$subtext</small>";
678 return "<h2>$heading " .
"$subtext</h2>";
682 return "<h2>$heading</h2>";
701 $atm =
date(
"Y-m-d G:i:s");
705 if (
$res =
$db->query(
"SELECT cw.id,cw.published,cw.widgetType,cw.pageID,cw.sort,cw.position, cw.date_publish, cw.date_unpublish, cwt.name, cwt.folder
707 JOIN {widget_types} as cwt on cw.widgetType = cwt.id
708 WHERE (cw.pageID = '" . $currentpage->id .
"' OR cw.pageID = '0')
709 AND cw.position = '" .
$position .
"' AND published = '1'
712 while ($row = mysqli_fetch_assoc(
$res))
714 $_GET[
'widgetID'] = $row[
'id'];
717 if ($atm > $row[
'date_publish'] || ($row[
'date_publish'] === NULL) || (empty($row[
'date_publish'])))
720 if ($atm < $row[
'date_unpublish'] || ($row[
'date_unpublish'] === NULL) || (empty($row[
'date_unpublish'])))
722 $widgetFile =
"system/widgets/".$row[
'folder'].
"/".$row[
'folder'].
".php";
734 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get widgets of position <b>$position</b>", 0, 0, 0, 0);
746 static function getWidgetId(
$db,
$id)
749 if (
$res =
$db->query(
"SELECT cp.id
751 JOIN {widgets} as cw on cp.id = cw.pageID
754 while ($row = mysqli_fetch_row(
$res))
767 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get widget ID <b>$id</b>", 0, 0, 0, 0);
780 static function getWidget(
$db,
$id)
783 global $allpagescode;
784 if (
$res =
$db->query(
"SELECT cw.pageID, cp.title
786 LEFT JOIN {pages} as cp on cp.id = cw.pageID
787 WHERE cw.id = '" .
$id .
"'"))
789 while ($row = mysqli_fetch_array(
$res))
794 $row[1] =
"--all pages--";
800 $allpagescode =
"<option value=\"0\">-- all pages--</option>";
806 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get widget ID <b>$id</b>", 0, 0, 0, 0);
815 static function getWidgetsArray(
$db)
817 if (
$res =
$db->query(
"SELECT id, name, (
820 WHERE widgetType = {widget_types}.id)
825 $WidgetsArray = array();
826 while ($row =
$res->fetch_assoc())
828 $WidgetsArray[] = $row;
834 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get widgets from db", 0, 0, 0, 0);
846 static function getContentWidget(
$db,
$id)
849 if (
$res =
$db->query(
"SELECT cw.id,cw.published,cw.widgetType,cw.pageID,cw.sort,cw.position, cwt.name, cwt.folder
851 JOIN {widget_types} as cwt on cw.widgetType = cwt.id
852 WHERE cw.id = '" .
$id .
"' AND published = '1'
855 while ($row = mysqli_fetch_array(
$res)) {
857 $widgetFile =
"system/widgets/$row[7]/$row[7].php";
858 return include $widgetFile;
862 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get content widget ID <b>$id</b>", 0, 0, 0, 0);
876 static function loadWidget(
$db,
$id)
879 if (
$res =
$db->query(
"SELECT cw.id,cw.published,cw.widgetType, cwt.name, cwt.folder
881 JOIN {widget_types} as cwt on cw.widgetType = cwt.id
882 WHERE cw.id = '" .
$id .
"'
886 while ($row = mysqli_fetch_array(
$res)) {
887 return include(
"system/widgets/$row[4]/$row[4].php?widgetID=$id");
890 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to load widget ID <b>$id</b>", 0, 0, 0, 0);
891 echo
"failed to load widget!";
903 return include
'system/widgets/loginbox/loginbox.php';
911 include
'system/widgets/fb_like/fb_like.php';
925 if (
$res =
$db->query(
"UPDATE {widgets}
927 WHERE id = '" .
$id .
"'"))
930 \YAWK\sys::setSyslog(
$db, 37, 0,
"toggled widget ID <b>$id</b> to $status", 0, 0, 0, 0);
936 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to toggle widget ID <b>$id</b> to $status", 0, 0, 0, 0);
949 $originalWidgetID =
$id;
951 if ($res_widgets =
$db->query(
"SELECT * FROM {widgets} WHERE id = '" .
$id .
"'"))
954 if ($res_id =
$db->query(
"SELECT MAX(id), MAX(sort) FROM {widgets}"))
956 $row = mysqli_fetch_row($res_id);
966 $row = mysqli_fetch_assoc($res_widgets);
973 if (
$res =
$db->query(
"INSERT INTO {widgets}
974 (id, published, widgetType, pageID, sort, position)
975 VALUES('" .
$id .
"',
983 if (
$settings =
$db->query(
"SELECT * FROM {widget_settings} WHERE widgetID = '".$originalWidgetID.
"'"))
985 while ($settingsResult = mysqli_fetch_assoc(
$settings))
987 $widgetID = $settingsResult[
'widgetID'];
988 $property = $settingsResult[
'property'];
989 $value = $settingsResult[
'value'];
991 $activated = $settingsResult[
'activated'];
992 $sortation = $settingsResult[
'sortation'];
993 $label = $settingsResult[
'label'];
994 $icon = $settingsResult[
'icon'];
995 $heading = $settingsResult[
'heading'];
996 $subtext = $settingsResult[
'subtext'];
997 $fieldClass = $settingsResult[
'fieldClass'];
998 $fieldType = $settingsResult[
'fieldType'];
999 $placeholder = $settingsResult[
'placeholder'];
1000 $options = $settingsResult[
'options'];
1001 $description = $settingsResult[
'description'];
1004 $db->query(
"INSERT INTO {widget_settings} (widgetID, property, value, widgetType, activated, sortation, label, icon, heading, subtext, fieldClass, fieldType, placeholder, options, description)
1005 VALUES('" .
$id .
"',
1006 '" . $property .
"',
1009 '" . $activated .
"',
1010 '" . $sortation .
"',
1015 '" . $fieldClass .
"',
1016 '" . $fieldType .
"',
1017 '" . $placeholder .
"',
1019 '" . $description .
"')");
1028 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to copy settings of widget ID <b>$id</b>", 0, 0, 0, 0);
1035 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to copy widget ID <b>$id</b>", 0, 0, 0, 0);
1041 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get widget ID <b>$id</b>", 0, 0, 0, 0);
1052 function delete(
$db, $widget)
1055 if (
$res =
$db->query(
"DELETE FROM {widgets} WHERE id = '" . $widget .
"'")) {
1057 if (!$res_settings =
$db->query(
"DELETE FROM {widget_settings} WHERE widgetID = '" . $widget .
"'")) {
1059 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to delete settings of widget ID <b>$widget</b>", 0, 0, 0, 0);
1064 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to delete widget ID <b>$widget</b>", 0, 0, 0, 0);
1075 function loadProperties(
$db,
$id)
1082 if (
$res =
$db->query(
"SELECT cw.id, cw.published,cw.widgetType,cw.pageID,cw.sort,cw.position, cw.date_publish, cw.date_unpublish, cw.widgetTitle, cwt.name, cw.marginTop, cw.marginBottom, cwt.folder
1083 FROM {widgets} as cw
1084 JOIN {widget_types} as cwt on cw.widgetType = cwt.id
1085 WHERE cw.id = '" .
$id .
"'"))
1087 if ($row = mysqli_fetch_assoc(
$res))
1089 $this->
id = $row[
'id'];
1091 $this->widgetType = $row[
'widgetType'];
1092 $this->pageID = $row[
'pageID'];
1093 $this->sort = $row[
'sort'];
1094 $this->position = $row[
'position'];
1095 $this->
name = $row[
'name'];
1096 $this->marginTop = $row[
'marginTop'];
1097 $this->marginBottom = $row[
'marginBottom'];
1100 $this->widgetTitle = $row[
'widgetTitle'];
1101 $this->folder = $row[
'folder'];
1106 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to fetch widget properties of ID <b>$id</b>", 0, 0, 0, 0);
1112 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to query widget properties of ID <b>$id</b>", 0, 0, 0, 0);
1125 $this->position = mb_strtolower($this->position);
1127 if (empty($this->pageID || (!isset($this->pageID)))) { $this->pageID = 0; }
1132 if (
$db->query(
"UPDATE {widgets} SET
1133 published = '" . $this->published .
"',
1134 widgetType = '" . $this->widgetType .
"',
1135 pageID = '" . $this->pageID .
"',
1136 sort = '" . $this->sort .
"',
1137 position = '" . $this->position .
"',
1138 date_publish = '" . $this->date_publish.
"',
1139 date_unpublish = NULL,
1140 widgetTitle = '" . $this->widgetTitle.
"'
1141 WHERE id = '" . $this->id .
"'"))
1147 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to save widget settings of ID: <b>$this->id</b> (unpublish not set)", 0, 0, 0, 0);
1155 if (
$db->query(
"UPDATE {widgets} SET
1156 published = '" . $this->published .
"',
1157 widgetType = '" . $this->widgetType .
"',
1158 pageID = '" . $this->pageID .
"',
1159 sort = '" . $this->sort .
"',
1160 position = '" . $this->position .
"',
1161 date_publish = '" . $this->date_publish.
"',
1162 date_unpublish = '" . $this->date_unpublish.
"',
1163 widgetTitle = '" . $this->widgetTitle.
"'
1164 WHERE id = '" . $this->id .
"'"))
1170 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to save widget settings of ID: <b>$this->id</b> (unpublish set)", 0, 0, 0, 0);
1184 if (isset(
$page->id) && (is_numeric(
$page->id)))
1186 $row =
$db->query(
"SELECT cw.id,cw.published,cw.widgetType,cw.pageID,cw.sort,cw.position, cw.date_publish, cw.date_unpublish, cw.widgetTitle, cwt.name, cwt.folder
1187 FROM {widgets} as cw
1188 JOIN {widget_types} as cwt on cw.widgetType = cwt.id
1189 WHERE (cw.pageID = '" .
$page->id .
"' OR cw.pageID = '0')
1193 while (
$result = mysqli_fetch_assoc($row)){
1196 if (isset($list) && (is_array($list))){
1213 $row =
$db->query(
"SELECT * FROM {widget_types} ORDER BY name");
1214 while (
$res = mysqli_fetch_assoc($row))
1223 \YAWK\sys::setSyslog(
$db, 39, 1,
"failed to get list of widget types. $widgetTypes is empty or not set.", 0, 0, 0, 0);
print $lang['FILEMAN_UPLOAD']
if(!isset($blog)) if(!isset($language)||(!isset($lang))) if(!isset($db)) $blog published
static setEditorSettingsForCustomHtmlWidget($editorSettings)
output a html script area with all editor options
static loadJavascript($editorSettings)
load all required javascript and css files
static inject(array $lang, string $pathToFile)
allow plugins to inject language tags to $lang array
static getEditorSettings($db, $typeID=0)
Returns an associative array containing the editor settings.
static getDirPrefix($db)
if yawk is installed into a subdirectory, use this to get this prefix directory
static iStatusToString($i, $on, $off)
convert a integer status to string variable (0|1) to online / offline
static checkIfAssetsAreLoaded($db, $assets, $switch)
Check if assets are loaded, load if switch is true.
This class serves methods to create backup from files.
if($page->alias==="index") $editorSettings
print $page date_unpublish
if(isset($_POST['save'])) $settings