Commit 9cafea64 authored by Matthias Larisch's avatar Matthias Larisch

Fix remaining IntelliJ inspector messages

parent 2f1fd9b0
......@@ -568,25 +568,16 @@ class ManualDb extends Db
}
}
public function addMessage($sender_id, $recip_id, $name, $message, $attach)
{
$model = new MessageModel();
if ($cid = $model->addConversation(array($sender_id => $sender_id, $recip_id => $recip_id), false, false)) {
$model->sendMessage($cid, $message, $sender_id);
$this->func->mailMessage($sender_id, $recip_id, $message);
}
return $id;
}
public function add_message($data)
{
$model = new MessageModel();
if ($cid = $model->addConversation(array($data['sender_id'] => $data['sender_id'], $data['recip_id'] => $data['recip_id']), false, false)) {
$model->sendMessage($cid, $data['msg'], $data['sender_id']);
return true;
}
return $id;
return false;
}
public function add_content($data)
......@@ -1725,7 +1716,7 @@ class ManualDb extends Db
$attach_db = json_encode(array($attach));
}
if (!isOrgaTeam()) {
if (!$this->func->isOrgaTeam()) {
$mode = 1;
}
......
......@@ -1539,9 +1539,6 @@ Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV:<br />
$db = new $mod();
}
if (isset($_GET['gid'])) {
$db->readGlocke($_GET['gid']);
}
include 'control/' . $page . '.php';
}
}
......@@ -1962,6 +1959,8 @@ Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV:<br />
case 'png':
$img_r = imagecreatefrompng($path . '/' . $img);
break;
default:
$img_r = null;
}
$dst_r = imagecreatetruecolor($targ_w, $targ_h);
......
......@@ -104,21 +104,21 @@ class ViewUtils
}
if ((int)$b['public_time'] != 0) {
$b['public_info'] .= '<div>Es wird in etwa ' . $this->func->s('pubbtime_' . (int)$b['public_time']) . ' abgeholt</div><div class="ui-padding">' . v_info('Bitte niemals ohne Absprache zum Laden kommen!') . '</div>';
$b['public_info'] .= '<div>Es wird in etwa ' . $this->func->s('pubbtime_' . (int)$b['public_time']) . ' abgeholt</div><div class="ui-padding">' . $this->v_info('Bitte niemals ohne Absprache zum Laden kommen!') . '</div>';
}
if (!empty($b['public_info'])) {
$besonderheiten = v_input_wrapper($this->func->s('info'), $b['public_info'], 'bcntspecial');
$besonderheiten = $this->v_input_wrapper($this->func->s('info'), $b['public_info'], 'bcntspecial');
}
$status = v_getStatusAmpel($b['betrieb_status_id']);
$status = $this->v_getStatusAmpel($b['betrieb_status_id']);
return '
' . v_input_wrapper($this->func->s('status'), $status . '<span class="bstatus">' . s('betrieb_status_' . $b['betrieb_status_id']) . '</span>' . $count_info) . '
' . v_input_wrapper('Verantwortliche Foodsaver', $verantwortlich, 'bcntverantwortlich') . '
' . $this->v_input_wrapper($this->func->s('status'), $status . '<span class="bstatus">' . $this->func->s('betrieb_status_' . $b['betrieb_status_id']) . '</span>' . $count_info) . '
' . $this->v_input_wrapper('Verantwortliche Foodsaver', $verantwortlich, 'bcntverantwortlich') . '
' . $besonderheiten . '
<div class="ui-padding">
' . v_info('' . $this->func->s('team_status_' . $b['team_status']) . '') . '
' . $this->v_info('' . $this->func->s('team_status_' . $b['team_status']) . '') . '
</div>
' . $button;
}
......@@ -207,7 +207,7 @@ class ViewUtils
$js .= ';';
addXhJs($js);
$this->func->addXhJs($js);
return '<input type="submit" id="' . $id . '" name="' . $id . '" value="' . $label . '" />';
}
......
......@@ -2,6 +2,7 @@
namespace Foodsharing\Lib\Xhr;
use Exception;
use Flourish\fImage;
use Foodsharing\Lib\Db\Mem;
use Foodsharing\Lib\Session\S;
......@@ -16,6 +17,7 @@ class XhrMethods
{
private $model;
private $func;
private $v_utils;
/**
* XhrMethods constructor.
......@@ -26,6 +28,8 @@ class XhrMethods
{
global $g_func;
$this->func = $g_func;
global $g_view_utils;
$this->v_utils = $g_view_utils;
$this->model = $model;
}
......@@ -34,7 +38,7 @@ class XhrMethods
$fsmodel = new FoodsaverModel();
$bids = $fsmodel->getFsBezirkIds((int)$data['fid']);
if ($this->func->isBotForA($bids, false, true) || isOrgaTeam()) {
if ($this->func->isBotForA($bids, false, true) || $this->func->isOrgaTeam()) {
if ($countver = $this->model->qOne('SELECT COUNT(*) FROM ' . PREFIX . 'verify_history WHERE date BETWEEN NOW()- INTERVAL 20 SECOND AND now() AND bot_id = ' . $this->func->fsId() . '')) {
if ($countver > 10) {
return json_encode(array(
......@@ -198,7 +202,7 @@ class XhrMethods
$fields = $this->func->unsetAll($data, array('photo_public', 'lat', 'lon', 'stadt', 'plz', 'anschrift'));
if ($this->model->updateFields($fields, 'foodsaver', $this->func->fsId())) {
return xhr_out();
return $this->xhr_out();
}
}
}
......@@ -208,7 +212,7 @@ class XhrMethods
if ($this->model->isInTeam($data['bid']) || $this->func->isOrgaTeam() || $this->func->isBotschafter()) {
if (isset($_SESSION['last_pinPost'])) {
if ((time() - $_SESSION['last_pinPost']) < 2) {
return xhr_getPinPost($data);
return $this->xhr_getPinPost($data);
}
}
if ($this->model->add_betrieb_notiz(array(
......@@ -232,7 +236,7 @@ class XhrMethods
), 'store-wallpost-' . (int)$data['bid']);
$_SESSION['last_pinPost'] = time();
return xhr_getPinPost($data);
return $this->xhr_getPinPost($data);
}
}
}
......@@ -330,9 +334,9 @@ class XhrMethods
$detail .= '<p>' . $this->func->s($key) . ':<br />' . $v . '</p>';
}
$detail = v_input_wrapper('Daten vom Google-Formular', $detail);
$detail = $this->v_utils->v_input_wrapper('Daten vom Google-Formular', $detail);
} else {
$detail = v_input_wrapper('Daten aus Anmeldeformular', '<pre>' . print_r($fsdata, true) . '</pre>');
$detail = $this->v_utils->v_input_wrapper('Daten aus Anmeldeformular', '<pre>' . print_r($fsdata, true) . '</pre>');
}
$thead = '<li><a href="#ptab-' . (int)$foodsaver['id'] . '-2">Details</a></li>';
......@@ -434,7 +438,7 @@ class XhrMethods
public function xhr_jsonBoth($data)
{
return xhr_jsonFoodsaver($data) . "\n" . xhr_jsonBetriebe($data);
return $this->xhr_jsonFoodsaver($data) . "\n" . $this->xhr_jsonBetriebe($data);
}
public function xhr_jsonFoodsaver($data)
......@@ -527,6 +531,7 @@ class XhrMethods
public function xhr_uploadPicture($data)
{
$func = '';
$id = strtolower($data['id']);
$id = preg_replace('/[^a-z0-9_]/', '', $id);
if (isset($_FILES['uploadpic'])) {
......@@ -591,6 +596,8 @@ class XhrMethods
case 'png':
$img_r = imagecreatefrompng($path . '/' . $img);
break;
default:
$img_r = null;
}
$dst_r = @imagecreatetruecolor($targ_w, $targ_h);
......@@ -699,7 +706,7 @@ class XhrMethods
public function xhr_getFoodsaver($data)
{
return xhr_getRecip($data);
return $this->xhr_getRecip($data);
}
public function xhr_getRecip($data)
......@@ -721,12 +728,8 @@ class XhrMethods
if (isset($_FILES['photo']) && (int)$_FILES['photo']['size'] > 0) {
$ext = explode('.', $_FILES['photo']['name']);
$ext = strtolower(end($ext));
//$bild = uploadPhoto();
//$new_filename =
@unlink('./images/' . $user_id . '.' . $ext);
@unlink('./images/' . $file);
$file = $this->func->makeUnique() . '.' . $ext;
if (move_uploaded_file($_FILES['photo']['tmp_name'], './images/' . $file)) {
......@@ -982,7 +985,7 @@ class XhrMethods
(
' . $this->model->intval($data['bid']) . ',
' . $this->model->intval($data['newfetchtime'][$i]) . ',
' . $this->model->strval($this->func->preZero($data['nfttime']['hour'][$i]) . ':' . preZero($data['nfttime']['min'][$i]) . ':00') . ',
' . $this->model->strval($this->func->preZero($data['nfttime']['hour'][$i]) . ':' . $this->func->preZero($data['nfttime']['min'][$i]) . ':00') . ',
' . $this->model->intval($data['nft-count'][$i]) . '
)
');
......@@ -1082,14 +1085,14 @@ class XhrMethods
$inputs = '<div id="' . $id . '">' . $inputs . '</div>';
$cats = $this->model->getBasics_bezirk();
$out['html'] = v_form('bezirkForm', array(
v_form_hidden('bezirk_id', (int)$data['id']),
v_form_select('parent_id', array('values' => $cats)),
v_form_select('master', array('label' => 'Master-Bezirk', 'desc' => 'Alle Foodsaver sind automatisch mit im Master-Bezirk, sofern einer angegeben wurde', 'values' => $cats)),
v_form_text('name'),
v_form_text('mailbox_name', ['desc' => 'Achtung! Nicht willkürlich ändern! Auch darauf achten, dass diese Adresse unter Mailboxen verwalten noch nicht existiert.']),
v_form_text('email_name', array('label' => 'Absendername')),
v_form_select('type', array('label' => 'Bezirkstyp', 'values' => array(
$out['html'] = $this->v_utils->v_form('bezirkForm', array(
$this->v_utils->v_form_hidden('bezirk_id', (int)$data['id']),
$this->v_utils->v_form_select('parent_id', array('values' => $cats)),
$this->v_utils->v_form_select('master', array('label' => 'Master-Bezirk', 'desc' => 'Alle Foodsaver sind automatisch mit im Master-Bezirk, sofern einer angegeben wurde', 'values' => $cats)),
$this->v_utils->v_form_text('name'),
$this->v_utils->v_form_text('mailbox_name', ['desc' => 'Achtung! Nicht willkürlich ändern! Auch darauf achten, dass diese Adresse unter Mailboxen verwalten noch nicht existiert.']),
$this->v_utils->v_form_text('email_name', array('label' => 'Absendername')),
$this->v_utils->v_form_select('type', array('label' => 'Bezirkstyp', 'values' => array(
array('id' => '1', 'name' => 'Stadt'),
array('id' => '8', 'name' => 'Großstadt (ohne Anmeldemöglichkeit)'),
array('id' => '9', 'name' => 'Stadtteil'),
......@@ -1099,9 +1102,9 @@ class XhrMethods
array('id' => '6', 'name' => 'Land'),
array('id' => '7', 'name' => 'Orgateam')
))),
v_input_wrapper($this->func->s($id), $inputs, $id)
$this->v_utils->v_input_wrapper($this->func->s($id), $inputs, $id)
), array('submit' => $this->func->s('save'))) .
v_input_wrapper('Master-Update', '<a class="button" href="#" class="button" onclick="if(confirm(\'Master-Update wirklich starten?\')){ajreq(\'masterupdate\',{app:\'geoclean\',id:' . (int)$data['id'] . '});}return false;">Master-Update starten</a>', 'masterupdate', array('desc' => 'Bei allen Kindbezirken ' . $g_data['name'] . ' als Master eintragen'));
$this->v_utils->v_input_wrapper('Master-Update', '<a class="button" href="#" class="button" onclick="if(confirm(\'Master-Update wirklich starten?\')){ajreq(\'masterupdate\',{app:\'geoclean\',id:' . (int)$data['id'] . '});}return false;">Master-Update starten</a>', 'masterupdate', array('desc' => 'Bei allen Kindbezirken ' . $g_data['name'] . ' als Master eintragen'));
$out['script'] = '
$("#bezirkform-form").unbind("submit");
......@@ -1179,7 +1182,7 @@ class XhrMethods
$verantwortlicher = '<p><a href="#" onclick="profile(' . (int)$b['id'] . ');return false;"><img src="' . $this->func->img() . '" /></a><a href="#" onclick="profile(' . (int)$b['id'] . ');return false;">' . $v['name'] . '</a> ist verantwortlich</p>';
}
$out['betriebe'][$i]['bubble'] = '<div style="height:110px;overflow:hidden;width:270px;"><div style="margin-right:5px;float:right;">' . $img . '</div><h1 style="font-size:13px;font-weight:bold;margin-bottom:8px;"><a onclick="betrieb(' . (int)$b['id'] . ');return false;" href="#">' . $this->func->jsSafe($b['name']) . '</a></h1><p>' . jsSafe($b['str'] . ' ' . $b['hsnr']) . '</p><p>' . jsSafe($b['plz']) . ' ' . jsSafe($b['stadt']) . '</p>' . $button . '</div><div style="clear:both;"></div>';
$out['betriebe'][$i]['bubble'] = '<div style="height:110px;overflow:hidden;width:270px;"><div style="margin-right:5px;float:right;">' . $img . '</div><h1 style="font-size:13px;font-weight:bold;margin-bottom:8px;"><a onclick="betrieb(' . (int)$b['id'] . ');return false;" href="#">' . $this->func->jsSafe($b['name']) . '</a></h1><p>' . $this->func->jsSafe($b['str'] . ' ' . $b['hsnr']) . '</p><p>' . $this->func->jsSafe($b['plz']) . ' ' . $this->func->jsSafe($b['stadt']) . '</p>' . $button . '</div><div style="clear:both;"></div>';
}
}
......@@ -1315,7 +1318,7 @@ class XhrMethods
$this->model->update_bezirkNew($data['bezirk_id'], $g_data);
return xhr_out('', 'pulseInfo("' . $this->func->s('edit_success') . '");');
return $this->xhr_out('', 'pulseInfo("' . $this->func->s('edit_success') . '");');
}
public function xhr_addFetcher($data)
......@@ -1542,14 +1545,14 @@ class XhrMethods
public function xhr_delPost($data)
{
$db = new RegionModel();
$regionModel = new RegionModel();
$fsid = $this->model->getVal('foodsaver_id', 'theme_post', $data['pid']);
$bezirkId = $this->model->getBezirkForPost($data['pid']);
$bezirkType = $this->model->getBezirkType($bezirkId);
$bezirkId = $regionModel->getBezirkForPost($data['pid']);
$bezirkType = $regionModel->getBezirkType($bezirkId);
if ($this->func->isOrgaTeam() || $fsid == $this->func->fsId() || ($this->func->isBotFor($bezirkId) && $bezirkType == 7)) {
$this->model->deletePost($data['pid']);
$regionModel->deletePost($data['pid']);
return 1;
} else {
......
......@@ -76,7 +76,7 @@ class BlogView extends View
$title = $this->func->s('edit_article');
global $g_data;
$this->func->addContent($this->v_utils->v_field(
v_activeSwitcher('blog_entry', $_GET['id'], $g_data['active']),
$this->v_utils->v_activeSwitcher('blog_entry', $_GET['id'], $g_data['active']),
'Status',
array('class' => 'ui-padding')
), CNT_LEFT);
......@@ -90,15 +90,15 @@ class BlogView extends View
}
return $this->v_utils->v_form('test', array(
v_field(
$this->v_utils->v_field(
$bezirkchoose .
v_form_text('name') . $this->v_utils->v_form_textarea('teaser', array('style' => 'height:75px;')) .
v_form_picture('picture', array('resize' => array(250, 528), 'crop' => array((250 / 135), (528 / 170)))),
$this->v_utils->v_form_text('name') . $this->v_utils->v_form_textarea('teaser', array('style' => 'height:75px;')) .
$this->v_utils->v_form_picture('picture', array('resize' => array(250, 528), 'crop' => array((250 / 135), (528 / 170)))),
$title,
array('class' => 'ui-padding')
),
v_field($this->v_utils->v_form_tinymce('body', array('nowrapper' => true, 'public_content' => true)), 'Inhalt')
$this->v_utils->v_field($this->v_utils->v_form_tinymce('body', array('nowrapper' => true, 'public_content' => true)), 'Inhalt')
));
}
}
......@@ -35,7 +35,7 @@ class BusinessCardView extends View
');
return $this->v_utils->v_quickform($this->func->s('options'), array(
v_form_select('opt', array('desc' => $this->func->s('opt_desc'), 'values' => $seldata))
$this->v_utils->v_form_select('opt', array('desc' => $this->func->s('opt_desc'), 'values' => $seldata))
), array('submit' => 'Visitenkarten erstellen')) . '
<div class="input-wrapper" id="dlbox" style="display:none;">
......
......@@ -244,14 +244,14 @@ class ContentControl extends Control
private function content_form($title = 'Content Management')
{
return $this->v_utils->v_form('faq', array(
v_field(
v_form_text('name', array('required' => true)) .
v_form_text('title', array('required' => true)),
$this->v_utils->v_field(
$this->v_utils->v_form_text('name', array('required' => true)) .
$this->v_utils->v_form_text('title', array('required' => true)),
$title,
array('class' => 'ui-padding')
),
v_field($this->v_utils->v_form_tinymce('body', array('filemanager' => true, 'public_content' => true, 'nowrapper' => true)), 'Inhalt')
$this->v_utils->v_field($this->v_utils->v_form_tinymce('body', array('filemanager' => true, 'public_content' => true, 'nowrapper' => true)), 'Inhalt')
), array('submit' => $this->func->s('save')));
}
......
......@@ -507,8 +507,6 @@ class DashboardView extends View
</div>
<div class="clear"></div>
</div>';
} else {
debug($u);
}
return $out;
......
......@@ -107,7 +107,7 @@ class EmailControl extends Control
$nachricht = $this->func->getPost('message');
$mailbox_id = $this->func->getPost('mailbox_id');
$nachricht = handleImages($nachricht);
$nachricht = $this->handleImages($nachricht);
$data = $this->func->getPostData();
......
......@@ -143,17 +143,17 @@ class EventView extends View
return $this->v_utils->v_field($this->v_utils->v_form('eventsss', array(
$public_el,
$bezirkchoose,
v_form_text('name', array('required' => true)),
v_form_date('date'),
v_form_date('dateend'),
v_input_wrapper('Uhrzeit Beginn', $this->v_utils->v_form_time('time_start', $start_time)),
v_input_wrapper('Uhrzeit Ende', $this->v_utils->v_form_time('time_end', $end_time)),
v_form_textarea('description', array('desc' => $this->func->s('desc_desc'), 'required' => true)),
v_form_select('online_type', array('values' => array(
$this->v_utils->v_form_text('name', array('required' => true)),
$this->v_utils->v_form_date('date'),
$this->v_utils->v_form_date('dateend'),
$this->v_utils->v_input_wrapper('Uhrzeit Beginn', $this->v_utils->v_form_time('time_start', $start_time)),
$this->v_utils->v_input_wrapper('Uhrzeit Ende', $this->v_utils->v_form_time('time_end', $end_time)),
$this->v_utils->v_form_textarea('description', array('desc' => $this->func->s('desc_desc'), 'required' => true)),
$this->v_utils->v_form_select('online_type', array('values' => array(
array('id' => 1, 'name' => $this->func->s('offline')),
array('id' => 0, 'name' => $this->func->s('online'))
))),
v_form_text('location_name', array('required' => true)),
$this->v_utils->v_form_text('location_name', array('required' => true)),
$this->latLonPicker('latLng')
), array('submit' => $this->func->s('save'))), $title, array('class' => 'ui-padding'));
}
......
......@@ -27,7 +27,7 @@ class FairTeilerView extends View
public function loginToFollow()
{
return $this->v_utils->v_field(
v_info('Wenn Du Dich einloggst kannst Du Dich benachrichtigen lassen bei Updates zu diesem FairTeiler')
$this->v_utils->v_info('Wenn Du Dich einloggst kannst Du Dich benachrichtigen lassen bei Updates zu diesem FairTeiler')
. $this->menu(array(array('name' => 'jetzt einloggen', 'click' => 'login();'))),
false
);
......@@ -103,8 +103,8 @@ class FairTeilerView extends View
public function address()
{
return $this->v_utils->v_field(
v_input_wrapper('Anschrift', $this->fairteiler['anschrift']) .
v_input_wrapper('PLZ / Ort', $this->fairteiler['plz'] . ' ' . $this->fairteiler['ort']),
$this->v_utils->v_input_wrapper('Anschrift', $this->fairteiler['anschrift']) .
$this->v_utils->v_input_wrapper('PLZ / Ort', $this->fairteiler['plz'] . ' ' . $this->fairteiler['ort']),
'Adresse',
array('class' => 'ui-padding')
);
......@@ -136,10 +136,10 @@ class FairTeilerView extends View
}
return $this->v_utils->v_field($this->v_utils->v_form('fairteiler', array(
v_form_select('bezirk_id', array('values' => $this->bezirke, 'required' => true)),
v_form_text('name', array('required' => true)),
v_form_textarea('desc', array('desc' => $this->func->s('desc_desc'), 'required' => true)),
v_form_picture('picture', array('resize' => array(528, 60), 'crop' => array((528 / 170), 1))),
$this->v_utils->v_form_select('bezirk_id', array('values' => $this->bezirke, 'required' => true)),
$this->v_utils->v_form_text('name', array('required' => true)),
$this->v_utils->v_form_textarea('desc', array('desc' => $this->func->s('desc_desc'), 'required' => true)),
$this->v_utils->v_form_picture('picture', array('resize' => array(528, 60), 'crop' => array((528 / 170), 1))),
$this->latLonPicker('latLng'),
$tagselect,
), array('submit' => $this->func->s('save'))), $title, array('class' => 'ui-padding'));
......@@ -170,7 +170,7 @@ class FairTeilerView extends View
width: 500,
resizable: false,
buttons: {
"' . s('save') . '": function(){
"' . $this->func->s('save') . '": function(){
goTo("' . $this->func->getSelf() . '&follow=1&infotype=" + $("input[name=\'infotype\']:checked").val());
}
}
......
......@@ -38,6 +38,7 @@ class FairTeilerXhr extends Control
if (!$this->mayFairteiler($_GET['fid'])) {
return false;
}
$post = '';
if ($ft = $this->model->getFairteiler($_GET['fid'])) {
if ($follower = $this->model->getEmailFollower($_GET['fid'])) {
......
......@@ -198,20 +198,20 @@ function foodsaver_form($title = 'Foodsaver')
return $this->v_utils->v_quickform($title, array(
$bezirkchoose,
$orga,
v_form_text('name', array('required' => true)),
v_form_text('nachname', array('required' => true)),
$this->v_utils->v_form_text('name', array('required' => true)),
$this->v_utils->v_form_text('nachname', array('required' => true)),
$position,
v_form_text('stadt', array('required' => true)),
v_form_text('plz', array('required' => true)),
v_form_text('anschrift', array('required' => true)),
v_form_text('lat'),
v_form_text('lon'),
v_form_text('email', array('required' => true, 'disabled' => true)),
v_form_text('telefon'),
v_form_text('handy'),
v_form_select('geschlecht', array('values' => array(
$this->v_utils->v_form_text('stadt', array('required' => true)),
$this->v_utils->v_form_text('plz', array('required' => true)),
$this->v_utils->v_form_text('anschrift', array('required' => true)),
$this->v_utils->v_form_text('lat'),
$this->v_utils->v_form_text('lon'),
$this->v_utils->v_form_text('email', array('required' => true, 'disabled' => true)),
$this->v_utils->v_form_text('telefon'),
$this->v_utils->v_form_text('handy'),
$this->v_utils->v_form_select('geschlecht', array('values' => array(
array('name' => 'Frau', 'id' => 2),
array('name' => 'Mann', 'id' => 1),
array('name' => 'beides oder Sonstiges', 'id' => 3)
......@@ -219,7 +219,7 @@ function foodsaver_form($title = 'Foodsaver')
array('required' => true)
)),
v_form_date('geb_datum', array('required' => true, 'yearRangeFrom' => (date('Y') - 111), 'yearRangeTo' => date('Y')))
$this->v_utils->v_form_date('geb_datum', array('required' => true, 'yearRangeFrom' => (date('Y') - 111), 'yearRangeTo' => date('Y')))
));
}
......@@ -247,10 +247,10 @@ function u_delete_account()
modal: true,
title: "' . $this->func->s('delete_account_confirm_title') . '",
buttons: {
"' . s('abort') . '" : function(){
"' . $this->func->s('abort') . '" : function(){
$("#delete-account-confirm").dialog("close");
},
"' . s('delete_account_confirm_bt') . '" : function(){
"' . $this->func->s('delete_account_confirm_bt') . '" : function(){
goTo("/?page=foodsaver&a=edit&id=' . (int)$_GET['id'] . '&deleteaccount=1");
}
}
......
......@@ -50,7 +50,7 @@ class FoodsaverView extends View
return
'<div id="' . $name . 'foodsaverlist">' .
v_field(
$this->v_utils->v_field(
$this->fsAvatarList($foodsaver, array('id' => 'fslist', 'shuffle' => false)),
$this->func->s('fs_in') . $bezirk['name'] . ($inactive ? $this->func->s('fs_list_not_logged_for_6_months') : '')
) . '
......
......@@ -27,7 +27,7 @@ class FoodsaverXhr extends Control
return array(
'status' => 1,
'script' => '$("#fsform").html(\'' . jsSafe($html) . '\');$(".button").button();$(".avatarlink img").load(function(){$(".avatarlink img").fadeIn();});'
'script' => '$("#fsform").html(\'' . $this->func->jsSafe($html) . '\');$(".button").button();$(".avatarlink img").load(function(){$(".avatarlink img").fadeIn();});'
);
}
}
......
......@@ -41,8 +41,8 @@ class GeoCleanView extends View
');
return
v_field(
v_tablesorter(array(
$this->v_utils->v_field(
$this->v_utils->v_tablesorter(array(
array('name' => $this->func->s('name'), 'width' => 150),
array('name' => $this->func->s('address')),
array('name' => $this->func->s('options'), 'width' => 240)
......
......@@ -151,8 +151,8 @@ class LoginControl extends Control
$this->func->addJs('$("#pass1").val("");');
$this->func->addContent($this->view->newPasswordForm($k));
} else {
$this->template->addLeft($this->view->error('Sorry, Du hast ein bisschen zu lange gewartet. Bitte beantrage ein neues Passwort!'));
$this->template->addLeft($this->view->passwordRequest());
$this->func->error('Sorry, Du hast ein bisschen zu lange gewartet. Bitte beantrage ein neues Passwort!');
$this->func->addContent($this->view->passwordRequest(), CNT_LEFT);
}
} else {
$this->func->addContent($this->view->passwordRequest());
......
......@@ -10,8 +10,8 @@ class LoginView extends View
public function loginForm()
{
return $this->v_utils->v_form_text('email_adress') .
v_form_passwd('password') .
v_form_hidden('ismob', '0') .
$this->v_utils->v_form_passwd('password') .
$this->v_utils->v_form_hidden('ismob', '0') .
'<p>
<a id="forgotpasswordlink" href="/?page=login&sub=passwordReset">Passwort vergessen?</a>
</p>';
......
......@@ -58,16 +58,16 @@ class MailboxView extends View
public function manageMemberBox($box)
{
return $this->v_utils->v_quickform($box['name'] . '@' . DEFAULT_HOST, array(
v_form_tagselect('foodsaver_' . $box['id'], array('label' => $this->func->s('mailbox_member'), 'xhr' => 'foodsaver')),
v_input_wrapper($this->func->s('email_name'), '<input type="text" value="' . $box['email_name'] . '" name="email_name" class="input text value">'),
v_form_hidden('mbid', $box['id'])
$this->v_utils->v_form_tagselect('foodsaver_' . $box['id'], array('label' => $this->func->s('mailbox_member'), 'xhr' => 'foodsaver')),
$this->v_utils->v_input_wrapper($this->func->s('email_name'), '<input type="text" value="' . $box['email_name'] . '" name="email_name" class="input text value">'),
$this->v_utils->v_form_hidden('mbid', $box['id'])
), array('submit' => $this->func->s('save')));
}
public function mailboxform()
{
return $this->v_utils->v_quickform($this->func->s('new_mailbox'), array(
v_form_text('name', array('desc' => $this->func->s('mailbox_name_desc')))
$this->v_utils->v_form_text('name', array('desc' => $this->func->s('mailbox_name_desc')))
), array('submit' => $this->func->s('save')));
}
......
......@@ -37,8 +37,8 @@ class PassportGeneratorView extends View
}
return
v_field(
v_tablesorter(array(
$this->v_utils->v_field(
$this->v_utils->v_tablesorter(array(
array('name' => '<input class="checker" type="checkbox" name="checker" value="' . $bezirk['id'] . '" />', 'sort' => false, 'width' => 20),
array('name' => $this->func->s('photo'), 'width' => 40),
array('name' => $this->func->s('name')),
......
......@@ -8,6 +8,7 @@ use Foodsharing\Modules\Core\Control;
class ProfileControl extends Control
{
private $foodsaver;
private $fs_id;
public function __construct()
{
......
......@@ -312,6 +312,7 @@ class ProfileView extends View
{
$out = '
<ul class="linklist history">';
$class = '';
$curdate = 0;
foreach ($history as $h) {
......
......@@ -159,8 +159,8 @@ class QuizView extends View
public function questionForm()
{
return
v_form_textarea('text') .
v_form_select('duration', array(
$this->v_utils->v_form_textarea('text') .
$this->v_utils->v_form_select('duration', array(
'values' => array(
array('id' => 10, 'name' => '10 Sekunden'),
array('id' => 20, 'name' => '20 Sekunden'),
......@@ -184,7 +184,7 @@ class QuizView extends View
array('id' => 200, 'name' => '3 Min 20 Sekunden')
)
)) .
v_form_select('fp', array(
$this->v_utils->v_form_select('fp', array(
'values' => array(
array('id' => 1, 'name' => '1 Fehlerpunkt'),
array('id' => 2, 'name' => '2 Fehlerpunkte'),
......@@ -193,15 +193,15 @@ class QuizView extends View
array('id' => 0, 'name' => 'keine Fehlerpunkte (Scherzfrage)')
)
)) .
v_form_text('wikilink');
$this->v_utils->v_form_text('wikilink');
}
public function answerForm()
{
return
v_form_textarea('text') .
v_form_textarea('explanation') .
v_form_select('isright', array('values' => array(
$this->v_utils->v_form_textarea('text') .
$this->v_utils->v_form_textarea('explanation') .
$this->v_utils->v_form_select('isright', array('values' => array(
array('id' => 1, 'name' => 'Richtig'),
array('id' => 0, 'name' => 'Falsch'),
array('id' => 2, 'name' => 'Neutral')
......
......@@ -907,6 +907,7 @@ class QuizXhr extends Control
private function resultNew($question, $diaId)
{
$uanswers = array();
$out = array();
if (isset($question['answers']) && is_array($question['answers'])) {
foreach ($question['answers'] as $a) {
......@@ -922,7 +923,6 @@ class QuizXhr extends Control
$joke = true;
}
$out = array();
foreach ($answers as $a) {
// schwerzfrageoder
if ($joke) {
......
......@@ -8,6 +8,8 @@ use Foodsharing\Modules\Core\Control;
class RegionXhr extends Control
{
private $responses;
public function __construct()
{
$this->responses = new XhrResponses();