Skip to content

Commit

Permalink
add title
Browse files Browse the repository at this point in the history
  • Loading branch information
CB9TOIIIA committed May 15, 2017
1 parent bdcc8f1 commit 0527671
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
19 changes: 12 additions & 7 deletions mod_simplecallback/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public static function getAjax()
$custom_textsimple = $params->get('simplecallback_custom_textsimple');
if(isset($data['simplecallback_page_url'])) { $page_url = strip_tags($data['simplecallback_page_url']); } else { $page_url = null;}
if(isset($data['custom_textsimple'])) { $custom_textsimple = strip_tags($data['custom_textsimple']);} else { $custom_textsimple = null;}



$body = "\n";
if(!empty($name)) : $body .= "\n". $params->get('simplecallback_name_field_label') . ": " . $name; endif;
if(!empty($phone)) : $body .= "\n". $params->get('simplecallback_phone_field_label') . ": " . $phone; endif;
Expand All @@ -81,7 +82,11 @@ public static function getAjax()
if(!empty($rating_enabled)) : $body .= "\n" . $params->get('simplecallback_rating_field_label') . ": " . $reviewStars; endif;
if(!empty($message)) : $body .= "\n" . $params->get('simplecallback_message_field_label') . ": " . $message; endif;
if(!empty($page_url) && $params->get('simplecallback_page_url') == 1) : $body .= "\n" . $params->get('simplecallback_page_url') . ": " . $page_url; endif;
$redirect_url_title = '';
if($params->get('simplacallback_redirect_url_title') == 1) : $redirect_url_title = JFactory::getApplication()->getParams()->get('page_title', ''); endif;
if(!empty($redirect_url_title) && $params->get('simplacallback_redirect_url_title') == 1) : $body .= "\n" . $params->get('simplacallback_redirect_url_title') . ": " . $redirect_url_title; endif;
if(!empty($simplecallback_custom_textsimple)) : $body .= "\n" . $custom_textsimple . ": " . $simplecallback_custom_textsimple; endif;
if(!empty($redirect_url_title)) { $redirect_url_title = 'Со страницы: '. $redirect_url_title; }

preg_match("/\d{1,}.\d{1,}.\d{1,}/", PHP_VERSION, $MyPHPver);
$MyPHPv = $MyPHPver[0];
Expand Down Expand Up @@ -243,7 +248,7 @@ public static function getAjax()
}

if ($telegram_enabled === '1' && !empty($telegram_chat_id)) {
$telegram_text = urlencode($datemsg . "\n" . $subject . "\n" . $name . "\n" . $emailclient . "\n" . $phone. "\n" . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple ."\n" . $message . $page_url);
$telegram_text = urlencode($datemsg . "\n" . $subject . "\n" . $name . "\n" . $emailclient . "\n" . $phone. "\n" . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple ."\n" . $message . "\n" . $page_url . "\n" . $redirect_url_title);
$telegram_request_url = 'https://telegram.cb9t.ru/modsimplecallbackbot/fromweb.php?chatid=' . $telegram_chat_id . '&text=' . $telegram_text;
$telegram_result = file_get_contents($telegram_request_url);
}
Expand Down Expand Up @@ -285,7 +290,7 @@ public static function getAjax()
}

if ($pushall_enabled === '1' && !empty($pushall_id)) {
$pushall_text = urlencode($datemsg . "\n" . $subject . "\n" . $name . "\n" . $emailclient . "\n" . $phone. "\n" . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . "\n" . $message . $page_url);
$pushall_text = urlencode($datemsg . "\n" . $subject . "\n" . $name . "\n" . $emailclient . "\n" . $phone. "\n" . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . "\n" . $message . "\n" . $page_url . "\n" . $redirect_url_title);
$pushall_request_url = 'https://pushall.ru/api.php?type=self&id='. $pushall_id .'&key='. $pushall_key .'&title=' . $subject . '&text=' . $pushall_text;
$pushall_result = file_get_contents($pushall_request_url);
}
Expand All @@ -297,7 +302,7 @@ public static function getAjax()
$payload = array(
'username' => $slack_username,
'icon_emoji' => $slack_icon_emoji,
'text' => $datemsg . PHP_EOL . $subject . PHP_EOL . $name . PHP_EOL . $emailclient . PHP_EOL . $phone. PHP_EOL . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . PHP_EOL . $message . $page_url . '----------------------',
'text' => $datemsg . PHP_EOL . $subject . PHP_EOL . $name . PHP_EOL . $emailclient . PHP_EOL . $phone. PHP_EOL . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . PHP_EOL . $message . "\n" . $page_url . "\n" . $redirect_url_title . '----------------------',
);
$jsonDataEncoded = json_encode($payload);
curl_setopt($ch, CURLOPT_URL, $url);
Expand All @@ -318,7 +323,7 @@ public static function getAjax()
$payload = array(
'username' => $mattermost_username,
'icon_emoji' => $mattermost_icon_emoji,
'text' => $datemsg . PHP_EOL . $subject . PHP_EOL . $name . PHP_EOL . $emailclient . PHP_EOL . $phone. PHP_EOL . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . PHP_EOL . $message . $page_url . '----------------------',
'text' => $datemsg . PHP_EOL . $subject . PHP_EOL . $name . PHP_EOL . $emailclient . PHP_EOL . $phone. PHP_EOL . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . PHP_EOL . $message . "\n" . $page_url . "\n" . $redirect_url_title . '----------------------',
);
$jsonDataEncoded = json_encode($payload);
curl_setopt($ch, CURLOPT_URL, $url);
Expand Down Expand Up @@ -355,7 +360,7 @@ function vkpush($method, $post = false) {
}
}

$vk_message = $datemsg . "\n" . $subject . "\n" . $name . "\n" . $emailclient . "\n" . $phone. "\n" . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . "\n" . $message . $page_url . " ".$vk_userpush;
$vk_message = $datemsg . "\n" . $subject . "\n" . $name . "\n" . $emailclient . "\n" . $phone. "\n" . $simplecallback_city_field_label. $simplecallback_city_field_labe2. $simplecallback_city_field_labe3 . $simplecallback_custom_textsimple . "\n" . $message . "\n" . $page_url . "\n" . $redirect_url_title . " ".$vk_userpush;

if ($vk_wall_post === '1') {

Expand Down Expand Up @@ -400,7 +405,7 @@ function vkpush($method, $post = false) {
if ($bitrix24_enabled === '1' && !empty($bitrix24_crm_host) && !empty($bitrix24_crm_login) && !empty($bitrix24_crm_password))
{

$message_b24 = $datemsg . " " . $simplecallback_city_field_label. " " .$simplecallback_city_field_labe2. " " . $simplecallback_city_field_labe3 . " " .$simplecallback_custom_textsimple ." " . $message;
$message_b24 = $datemsg . " " . $simplecallback_city_field_label. " " .$simplecallback_city_field_labe2. " " . $simplecallback_city_field_labe3 . " " .$simplecallback_custom_textsimple ." " . $message ." " . $page_url ." " . $redirect_url_title;

$postData = array(
'LOGIN' => $bitrix24_crm_login,
Expand Down
21 changes: 18 additions & 3 deletions mod_simplecallback/mod_simplecallback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<author>Eugene Kopylov</author>
<authoremail>[email protected]</authoremail>
<authorurl>https://github.com/CB9TOIIIA/simplecallback_fork_cb9t</authorurl>
<version>1.3.6</version>
<version>1.3.7</version>
<creationdate>24.02.2015</creationdate>
<description>
<![CDATA[Продвинутый модуль формы обратной связи для CMS Joomla! <br><b>Для настройки и добавление новых возможностей (мои контакты): Сайт: <a target="_blank" href="https://seosm.ru/">www.SEOSM.ru</a> Skype: cb9t.ru / Telegram: <a href="https://t.me/cb9toiiia" target="_blank">@CB9TOIIIA</a> / Почта: [email protected] </b><br><iframe frameborder='0' allowtransparency='true' scrolling='no' src='https://tpv.sr/1QoBXDF/' width='750' height='350'></iframe>]]>
Expand Down Expand Up @@ -90,6 +90,12 @@
label="Паттерн проверки (RegExp)"
description=""
default="(\+?\d[- .]*){6,14}"></field>
<field
type="spacer"
name="myspacerexexp4"
class="text"
label=" &amp;nbsp; &lt;b&gt; Универсальный RexExp: &amp;nbsp; &lt;b&gt; /(+|7|8|9)\d{14}/ "/>

<field
type="text"
name="simplecallback_city_field_label"
Expand Down Expand Up @@ -312,7 +318,7 @@
rows="5"
name="simplacallback_my_inline_css"
label="Свои CSS правила"
default=".simplecallback textarea { width: 100%; height: 125px; display: table; }" >
default=".simplecallback textarea { width: 100%; height: 125px; display: table; } .sweet-alert input[type='text'] { display: none !important; }" >
</field>
<field
type="radio"
Expand Down Expand Up @@ -346,7 +352,16 @@
label="URL страницы"
description=""
default=""></field>

<field
type="radio"
name="simplacallback_redirect_url_title"
label="Title страницы?"
description=""
default="0"
class="btn-group btn-group-yesno">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
type="radio"
name="simplacallback_my_text_before_enabled"
Expand Down
4 changes: 2 additions & 2 deletions updatemysimplecallback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<description>mod_simplecallback</description>
<element>mod_simplecallback</element>
<type>module</type>
<version>1.3.6</version>
<version>1.3.7</version>
<infourl title="mod_simplecallback">https://github.com/CB9TOIIIA/simplecallback_fork_cb9t/</infourl>
<downloads>
<downloadurl type="full" format="zip"><![CDATA[https://github.com/CB9TOIIIA/simplecallback_fork_cb9t/releases/download/1.3.6/mod_simplecallback_1.3.6.zip]]></downloadurl>
<downloadurl type="full" format="zip"><![CDATA[https://github.com/CB9TOIIIA/simplecallback_fork_cb9t/releases/download/1.3.7/mod_simplecallback_1.3.7.zip]]></downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down

0 comments on commit 0527671

Please sign in to comment.