Skip to content

Commit

Permalink
select 'Don't offer choice, default to HTML' by default (#341)
Browse files Browse the repository at this point in the history
Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>
  • Loading branch information
xh3n1 authored and michield committed Jun 6, 2018
1 parent b0490d3 commit 890c46c
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions public_html/lists/admin/spageedit.php
Expand Up @@ -126,7 +126,7 @@

//# initialise values from defaults
$data = array();
$data['title'] = $GLOBALS['I18N']->get('Subscribe to our newsletter');
$data['title'] = s('Subscribe to our newsletter');
$data['button'] = $strSubmit;
$data['intro'] = $strSubscribeInfo;
$data['language_file'] = ''; //$GLOBALS['language_module'];
Expand All @@ -140,10 +140,10 @@
$data['confirmationsubject'] = getConfig('confirmationsubject');
$data['unsubscribemessage'] = getConfig('unsubscribemessage');
$data['unsubscribesubject'] = getConfig('unsubscribesubject');
$data['htmlchoice'] = 'checkfortext';
$data['htmlchoice'] = 'htmlonly';
$data['emaildoubleentry'] = 'yes';
$data['rssdefault'] = 'daily'; //Leftover from the preplugin era
$data['rssintro'] = $GLOBALS['I18N']->get('Please indicate how often you want to receive messages'); //Leftover from the preplugin era
$data['rssintro'] = s('Please indicate how often you want to receive messages'); //Leftover from the preplugin era
$selected_lists = array();
$attributedata = array();

Expand Down Expand Up @@ -184,7 +184,7 @@
$generalinfoHTML .= '<div>';

$generalinfoHTML .= sprintf('<label for="title">%s</label><input type="text" name="title" value="%s" size="60" />',
$GLOBALS['I18N']->get('Title'),
s('Title'),
htmlspecialchars(stripslashes($data['title'])));

$language_file = $GLOBALS['language_module'];
Expand All @@ -200,70 +200,70 @@
}
asort($language_files);
$language_select = '<select name="language_file">';
$language_select .= '<option value="">--'.$GLOBALS['I18N']->get('default').'</option>';
$language_select .= '<option value="">--'.s('default').'</option>';
foreach ($language_files as $key => $val) {
$language_select .= sprintf('<option value="%s" %s>%s</option>', $key,
$key == $data['language_file'] ? 'selected="selected"' : '', $val);
}
$language_select .= '</select>';

$generalinfoHTML .= sprintf('<label for="language_file">%s</label>%s',
$GLOBALS['I18N']->get('Language file to use'), $language_select);
s('Language file to use'), $language_select);

$generalinfoHTML .= sprintf('<label for="intro">%s</label><textarea name="intro" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Intro'),
s('Intro'),
htmlspecialchars(stripslashes($data['intro'])));
$generalinfoHTML .= sprintf('<label for="header">%s</label><textarea name="header" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Header'),
s('Header'),
htmlspecialchars(stripslashes($data['header'])));
$generalinfoHTML .= sprintf('<label for="footer">%s</label><textarea name="footer" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Footer'),
s('Footer'),
htmlspecialchars(stripslashes($data['footer'])));
$generalinfoHTML .= sprintf('<label for="thankyoupage">%s</label><textarea name="thankyoupage" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Thank you page'),
s('Thank you page'),
htmlspecialchars(stripslashes($data['thankyoupage'])));

$generalinfoHTML .= sprintf('<label for="ajax_subscribeconfirmation">%s</label><textarea name="ajax_subscribeconfirmation" cols="60" rows="10" class="virtual">%s</textarea>',
s('Text to display when subscription with an AJAX request was successful'),
htmlspecialchars(stripslashes($data['ajax_subscribeconfirmation'])));

$generalinfoHTML .= sprintf('<label for="button">%s</label><input type="text" name="button" value="%s" size="60" />',
$GLOBALS['I18N']->get('Text for Button'),
s('Text for Button'),
htmlspecialchars($data['button']));
$generalinfoHTML .= sprintf('<label for="htmlchoice">%s</label>', $GLOBALS['I18N']->get('HTML Email choice'));
$generalinfoHTML .= sprintf('<label for="htmlchoice">%s</label>', s('HTML Email choice'));
$generalinfoHTML .= sprintf('<input type="radio" name="htmlchoice" value="textonly" %s />
%s <br/>',
$data['htmlchoice'] == 'textonly' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Don\'t offer choice, default to <b>text</b>'));
s('Don\'t offer choice, default to <b>text</b>'));
$generalinfoHTML .= sprintf('<input type="radio" name="htmlchoice" value="htmlonly" %s />
%s <br/>',
$data['htmlchoice'] == 'htmlonly' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Don\'t offer choice, default to <b>HTML</b>'));
s('Don\'t offer choice, default to <b>HTML</b>'));
$generalinfoHTML .= sprintf('<input type="radio" name="htmlchoice" value="checkfortext" %s />
%s <br/>',
$data['htmlchoice'] == 'checkfortext' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Offer checkbox for text'));
s('Offer checkbox for text'));
$generalinfoHTML .= sprintf('<input type="radio" name="htmlchoice" value="checkforhtml" %s />
%s <br/>',
$data['htmlchoice'] == 'checkforhtml' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Offer checkbox for HTML'));
s('Offer checkbox for HTML'));
$generalinfoHTML .= sprintf('<input type="radio" name="htmlchoice" value="radiotext" %s />
%s <br/>',
$data['htmlchoice'] == 'radiotext' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Radio buttons, default to text'));
s('Radio buttons, default to text'));
$generalinfoHTML .= sprintf('<input type="radio" name="htmlchoice" value="radiohtml" %s />
%s <br/>',
$data['htmlchoice'] == 'radiohtml' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Radio buttons, default to HTML'));
s('Radio buttons, default to HTML'));

$generalinfoHTML .= sprintf('<label for="emaildoubleentry">%s</label>',
$GLOBALS['I18N']->get('Display Email confirmation'));
s('Display Email confirmation'));
$generalinfoHTML .= sprintf('<input type="radio" name="emaildoubleentry" value="yes" %s />%s<br/>',
$data['emaildoubleentry'] == 'yes' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Display email confirmation'));
s('Display email confirmation'));
$generalinfoHTML .= sprintf('<input type="radio" name="emaildoubleentry" value="no" %s />%s<br/>',
$data['emaildoubleentry'] == 'no' ? 'checked="checked"' : '',
$GLOBALS['I18N']->get('Don\'t display email confirmation'));
s('Don\'t display email confirmation'));

$generalinfoHTML .= '</div>';

Expand All @@ -272,26 +272,26 @@
$transactionHTML = '<h3><a name="transaction">'.s('Transaction messages').'</a></h3>';

$transactionHTML .= '<div>';
$transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Message they receive when they subscribe').'</h4>';
$transactionHTML .= '<h4>'.s('Message they receive when they subscribe').'</h4>';
$transactionHTML .= sprintf('<label for="subscribesubject">%s</label><input type="text" name="subscribesubject" value="%s" size="60" />',
$GLOBALS['I18N']->get('Subject'),
s('Subject'),
htmlspecialchars(stripslashes($data['subscribesubject'])));
$transactionHTML .= sprintf('<label for="subscribemessage">%s</label><textarea name="subscribemessage" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Message'),
s('Message'),
htmlspecialchars(stripslashes($data['subscribemessage'])));
$transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Message they receive when they confirm their subscription').'</h4>';
$transactionHTML .= '<h4>'.s('Message they receive when they confirm their subscription').'</h4>';
$transactionHTML .= sprintf('<label for="confirmationsubject">%s</label><input type="text" name="confirmationsubject" value="%s" size="60" />',
$GLOBALS['I18N']->get('Subject'),
s('Subject'),
htmlspecialchars(stripslashes($data['confirmationsubject'])));
$transactionHTML .= sprintf('<label for="confirmationmessage">%s</label><textarea name="confirmationmessage" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Message'),
s('Message'),
htmlspecialchars(stripslashes($data['confirmationmessage'])));
$transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Message they receive when they unsubscribe').'</h4>';
$transactionHTML .= '<h4>'.s('Message they receive when they unsubscribe').'</h4>';
$transactionHTML .= sprintf('<label for="unsubscribesubject">%s</label><input type="text" name="unsubscribesubject" value="%s" size="60" />',
$GLOBALS['I18N']->get('Subject'),
s('Subject'),
htmlspecialchars(stripslashes($data['unsubscribesubject'])));
$transactionHTML .= sprintf('<label for="unsubscribemessage">%s</label><textarea name="unsubscribemessage" cols="60" rows="10" class="virtual">%s</textarea>',
$GLOBALS['I18N']->get('Message'),
s('Message'),
htmlspecialchars(stripslashes($data['unsubscribemessage'])));

$sendtest_content = sprintf('<div class="sendTest" id="sendTest">
Expand All @@ -309,7 +309,7 @@

echo $transactionHTML;

$attributesHTML = '<h3><a name="attributes">'.$GLOBALS['I18N']->get('Select the attributes to use').'</a></h3>';
$attributesHTML = '<h3><a name="attributes">'.s('Select the attributes to use').'</a></h3>';
$attributesHTML .= '<div>';
$hasAttributes = false;

Expand All @@ -328,13 +328,13 @@
}

$attributesHTML .= '<table class="spageeditListing" border="1" width="100%" bgcolor="'.$bgcol.'">';
$attributesHTML .= '<tr><td colspan="2" width="150">'.$GLOBALS['I18N']->get('Attribute').': '.$row['id'].'</td>';
$attributesHTML .= '<td colspan="2">'.$GLOBALS['I18N']->get('Check this box to use this attribute in the page').'<input type="checkbox" name="attr_use['.$row['id'].']" value="1" '.$checked[$row['id']].' /></td></tr>';
$attributesHTML .= '<tr><td colspan="2">'.$GLOBALS['I18N']->get('Name').': </td><td colspan="2"><h4>'.htmlspecialchars(stripslashes($row['name'])).'</h4></td></tr>';
$attributesHTML .= '<tr><td colspan="2">'.$GLOBALS['I18N']->get('Type').': </td><td colspan="2"><h4>'.$GLOBALS['I18N']->get($row['type']).'</h4></td></tr>';
$attributesHTML .= '<tr><td colspan="2">'.$GLOBALS['I18N']->get('Default Value').': </td><td colspan="2"><input type="text" name="attr_default['.$row['id'].']" value="'.htmlspecialchars(stripslashes($value['default_value'])).'" size="40" /></td></tr>';
$attributesHTML .= '<tr><td>'.$GLOBALS['I18N']->get('Order of Listing').': </td><td><input type="text" name="attr_listorder['.$row['id'].']" value="'.$value['listorder'].'" size="5" /></td>';
$attributesHTML .= '<td>'.$GLOBALS['I18N']->get('Is this attribute required?').': </td><td><input type="checkbox" name="attr_required['.$row['id'].']" value="1" ';
$attributesHTML .= '<tr><td colspan="2" width="150">'.s('Attribute').': '.$row['id'].'</td>';
$attributesHTML .= '<td colspan="2">'.s('Check this box to use this attribute in the page').'<input type="checkbox" name="attr_use['.$row['id'].']" value="1" '.$checked[$row['id']].' /></td></tr>';
$attributesHTML .= '<tr><td colspan="2">'.s('Name').': </td><td colspan="2"><h4>'.htmlspecialchars(stripslashes($row['name'])).'</h4></td></tr>';
$attributesHTML .= '<tr><td colspan="2">'.s('Type').': </td><td colspan="2"><h4>'.s($row['type']).'</h4></td></tr>';
$attributesHTML .= '<tr><td colspan="2">'.s('Default Value').': </td><td colspan="2"><input type="text" name="attr_default['.$row['id'].']" value="'.htmlspecialchars(stripslashes($value['default_value'])).'" size="40" /></td></tr>';
$attributesHTML .= '<tr><td>'.s('Order of Listing').': </td><td><input type="text" name="attr_listorder['.$row['id'].']" value="'.$value['listorder'].'" size="5" /></td>';
$attributesHTML .= '<td>'.s('Is this attribute required?').': </td><td><input type="checkbox" name="attr_required['.$row['id'].']" value="1" ';
$attributesHTML .= $value['required'] ? 'checked="checked"' : '';
$attributesHTML .= ' /></td></tr>';
$attributesHTML .= '</table><hr/>';
Expand All @@ -355,7 +355,7 @@
}
}

$listsHTML = '<h3><a name="lists">'.$GLOBALS['I18N']->get('Select the lists to offer').'</a></h3>';
$listsHTML = '<h3><a name="lists">'.s('Select the lists to offer').'</a></h3>';
$listsHTML .= '<div>';
$listsHTML .= '<p>'.s('You can only select "public" lists for subscribe pages.');
$req = Sql_query("SELECT * FROM {$tables['list']} $subselect order by listorder");
Expand Down Expand Up @@ -388,7 +388,7 @@
if (!isset($data['owner'])) {
$data['owner'] = 0;
}
$ownerHTML .= '<br/>'.$GLOBALS['I18N']->get('Owner').': <select name="owner">';
$ownerHTML .= '<br/>'.s('Owner').': <select name="owner">';
$admins = $GLOBALS['admin_auth']->listAdmins();
$adminCount = count($admins);
foreach ($admins as $adminid => $adminname) {
Expand All @@ -406,6 +406,6 @@
}

echo '
<input class="submit" type="submit" name="save" value="' .$GLOBALS['I18N']->get('Save Changes').'" />
<input class="submit" type="submit" name="save" value="' .s('Save Changes').'" />
</form>';
</form>';

0 comments on commit 890c46c

Please sign in to comment.