Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
oesantaa committed Nov 28, 2023
0 parents commit 2153973
Show file tree
Hide file tree
Showing 44 changed files with 20,155 additions and 0 deletions.
Binary file added Loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
SMS Notification Block

Author: Azmat Ullah, Talha Noor

Plugin Instalation

1) Copy plugin folder in moodle blocks folder
2) Login with Administrator on Moodle site
3) Install the plugin by clicking on 'update database' now button
4) Put SMS API ID, username and password in setting page


Clickatell
For Clickatell API, See http://www.clickatell.com
_________________________________
1) Create a developer account on Clickatell.com
2) Login with developer account
3) Click on Manage my Products tab
4) Copy API ID and paste it on Moodle setting page with username and password


Sendsms.pk(This API will only work in Pakistan)
For Send SMS API, See http://www.sendsms.pk/
_________________________________
1) Create an account on sendsms.pk
2) Login with account
3) Click SMS API under setting link
4) Copy API ID and paste it on Moodle setting page with username and password

56 changes: 56 additions & 0 deletions block_sms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/* SMS Notifier Block
* SMS notifier is a one way SMS messaging block that allows managers, teachers and administrators to
* send text messages to their student and teacher.
* @package blocks
* @author: Azmat Ullah, Talha Noor
* @date: 17-Jul-2014
*/

class block_sms extends block_base {

public function init() {
$this->title = get_string('sms', 'block_sms');
}

public function get_content() {
global $CFG, $USER, $COURSE;
if ($this->content !== null) {
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '';
$this->content->text .= html_writer::link(new moodle_url('/blocks/sms/view.php', array('viewpage' => '2')), get_string('sms_send', 'block_sms')) . '<br>';
$this->content->text .= html_writer::link(new moodle_url('/blocks/sms/view.php', array('viewpage' => '3')), get_string('sms_template', 'block_sms')) . '<br>';
return $this->content;
}

public function has_config() {
return true;
}

public function applicable_formats() {
return array('all' => true);
}

public function instance_allow_config() {
return true;
}

}
5 changes: 5 additions & 0 deletions config_global.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<form>
<input type="text" name="userform"/>
<input type="submit" value="Submit"/>

</form>
79 changes: 79 additions & 0 deletions db/access.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/* SMS notifier Block
* SMS notifier is a one way SMS messaging block that allows managers, teachers and administrators to
* send text messages to their student and teacher.
* @package blocks
* @author: Azmat Ullah, Talha Noor
* @date: 06-Jun-2013
*/

defined('MOODLE_INTERNAL') || die();

$capabilities = array(
'block/sms:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/my:manageblocks'
),

'block/sms:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
),

'clonepermissionsfrom' => 'moodle/site:manageblocks'
),

'block/sms:viewpages' => array(

'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_PREVENT,
'manager' => CAP_ALLOW,
'coursecreator' => CAP_PREVENT

)
),

'block/sms:managepages' => array(

'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
)
);
26 changes: 26 additions & 0 deletions db/install.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="blocks/sms/db" VERSION="20130429" COMMENT="XMLDB file for Moodle blocks/sms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="block_sms" COMMENT="Default comment for block_sms, please edit me" NEXT="block_sms_template">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="block_sms_template" COMMENT="block_sms_template table retrofitted from MySQL" PREVIOUS="block_sms">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="tname"/>
<FIELD NAME="tname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="id" NEXT="template"/>
<FIELD NAME="template" TYPE="text" NOTNULL="false" SEQUENCE="false" PREVIOUS="tname"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
39 changes: 39 additions & 0 deletions edit_form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/* SMS Notifier Block
* SMS notifier is a one way SMS messaging block that allows managers, teachers and administrators to
* send text messages to their student and teacher.
* @package blocks
* @author: Azmat Ullah, Talha Noor
* @date: 06-Jun-2013
*/

class block_sms_edit_form extends block_edit_form {

protected function specific_definition($mform) {
// Section header title according to language file.
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
// A sample string variable with a default value.
$mform->addElement('textarea', 'config_text', 'Embeded Code');
$mform->setDefault('config_text', 'default value');
$mform->setType('config_text', PARAM_MULTILANG);
$mform->addElement('text', 'config_title', get_string('blocktitle', 'block_sms'));
$mform->setDefault('config_title', 'default value');
$mform->setType('config_title', PARAM_MULTILANG);

}
}
70 changes: 70 additions & 0 deletions lang/en/block_sms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/* SMS Notifier Block
* SMS notification is a one way SMS messaging block that allows managers, teachers and administrators to
* send text messages to their student and teacher.
* @package blocks
* @author: Azmat Ullah, Talha Noor
* @date: 06-Jun-2013
*/

$string['pluginname'] = 'SMS Notifier';
$string['sms'] = 'SMS Notifier';
$string['sms_send'] = 'Send SMS';
$string['addpage'] = 'Add Page';
$string['textfields'] = 'Data';
$string['edithtml'] = 'Data Manipulation';
$string['pagetitle'] = 'Input Text';
$string['picturedesc'] = 'Description';
$string['sms_save'] = 'Message Template';
$string['sms_history'] = 'Message History';
$string['selectcourse'] = 'Select Course';
$string['selectrole'] = 'Select Role';
$string['sms_body'] = 'Message Body';
$string['selectmsg'] = 'Select Message';
$string['template'] = 'Create Message Template';
$string['sms_template'] = 'Create Message Template';
$string['sms_template_header'] = 'New Template';
$string['sms_api_key'] = 'API Key';
$string['sms_api_username'] = 'Username';
$string['sms_api_password'] = 'Password';
$string['sms_setting_header'] = 'SMS Notification Settings';
$string['block_sms_apikey'] = 'block_sms_apikey';
$string['block_sms_api_username'] = 'block_sms_api_username';
$string['block_sms_api_password'] = 'block_sms_api_password';
$string['sms:addinstance']='Add Instance';
$string['error'] = 'Error';
$string['sent'] = 'Sent';
$string['valid_key'] = 'Your key IS VALID';
$string['serial_no'] = 'Serial No.';
$string['name'] = 'Name';
$string['msg_body'] = 'Message Body';
$string['edit'] = 'Edit';
$string['delete'] = 'Delete';
$string['cell_no'] = 'Cell Number';
$string['select'] = 'Select';
$string['askfordelete'] = 'Do You Want to Delete This Template?';
$string['moodleuser'] = 'Username';
$string['usernumber'] = 'Numbers';
$string['status'] = 'Status';







Loading

0 comments on commit 2153973

Please sign in to comment.