Skip to content

Commit 1ba4333

Browse files
author
Bjørn Børresen
committed
Merge branch 'master' of github.com:bjornbjorn/snippetssync.ee2_addon
Conflicts: system/expressionengine/third_party/snippetssync/ext.snippetssync.php system/expressionengine/third_party/snippetssync/mcp.snippetssync.php system/expressionengine/third_party/snippetssync/upd.snippetssync.php
2 parents b369ae3 + b1f2919 commit 1ba4333

File tree

17 files changed

+612
-608
lines changed

17 files changed

+612
-608
lines changed

INSTALLING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
How to install
22
==============
3-
* Copy both the "libraries" and the "snippetssync" folder into /expressionengine/third_party/
3+
* Copy both the "/system/expressionengine/third_party/libraries/" and the "/system/expressionengine/third_party/snippetssync/" folders into /system/expressionengine/third_party/
44
* Navigate to Addons -> Extensions -> Enable SnippetsSync
55

66
That's it.

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ Changelog for SnippetsSync
22
==========================
33
The dates in this changelog use international date format: YYYY-MM-DD (ISO8601)
44

5+
1.0.7 - 2013-05-20
6+
------------------
7+
* Modified add-on folder structure for DevDemon Updater compatibility
8+
59
1.0.6 - 2013-04-15
610
------------------
711
* Fixed bug where global variables were not allowed to be saved w/.html extension
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2-
3-
/**
4-
* AddonBakery Common
5-
*
6-
* All classes extend this
7-
*
8-
*/
9-
10-
class Ab_Common {
11-
12-
/**
13-
* @var Devkit_code_completion;
14-
*/
15-
protected $EE;
16-
17-
public function __construct()
18-
{
19-
$this->EE =& $this->get_ee_instance();
20-
$this->EE->load->add_package_path(PATH_THIRD); // add common lib folder to package path
21-
}
22-
23-
/**
24-
* @return Devkit_code_completion
25-
*/
26-
private function get_ee_instance()
27-
{
28-
return get_instance();
29-
}
1+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2+
3+
/**
4+
* AddonBakery Common
5+
*
6+
* All classes extend this
7+
*
8+
*/
9+
10+
class Ab_Common {
11+
12+
/**
13+
* @var Devkit_code_completion;
14+
*/
15+
protected $EE;
16+
17+
public function __construct()
18+
{
19+
$this->EE =& $this->get_ee_instance();
20+
$this->EE->load->add_package_path(PATH_THIRD); // add common lib folder to package path
21+
}
22+
23+
/**
24+
* @return Devkit_code_completion
25+
*/
26+
private function get_ee_instance()
27+
{
28+
return get_instance();
29+
}
3030
}
Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
1-
<?php
2-
require_once 'ab_common'.EXT;
3-
4-
/**
5-
* Base for extensions
6-
*
7-
*/
8-
9-
class Ab_ExtBase extends Ab_Common
10-
{
11-
public $settings = array();
12-
protected $register_hooks; // array of hooks => methods to register
13-
14-
public function __construct($settings='')
15-
{
16-
parent::__construct(); // run constructor which will handle get_instance() etc.
17-
$this->settings = $settings;
18-
}
19-
20-
/**
21-
* Activate the extension
22-
*
23-
* This funciton is run on install and will register all hooks and
24-
* add custom member fields.
25-
*
26-
*/
27-
public function activate_extension()
28-
{
29-
// -------------------------------------------------
30-
// Register the hooks needed for this extension
31-
// -------------------------------------------------
32-
33-
$class_name = get_class($this);
34-
foreach($this->register_hooks as $hook => $method)
35-
{
36-
$data = array(
37-
'class' => $class_name,
38-
'method' => $method,
39-
'hook' => $hook,
40-
'settings' => "",
41-
'priority' => 10,
42-
'version' => $this->version,
43-
'enabled' => "y"
44-
);
45-
$this->EE->db->insert('extensions', $data);
46-
}
47-
}
48-
49-
/**
50-
* Update the extension
51-
*
52-
* @param $current current version number
53-
* @return boolean indicating whether or not the extension was updated
54-
*/
55-
public function update_extension($current='')
56-
{
57-
if ($current == '' OR $current == $this->version)
58-
{
59-
return FALSE;
60-
}
61-
62-
return FALSE;
63-
// update code if version differs here
64-
}
65-
66-
/**
67-
* Settings
68-
*/
69-
public function settings()
70-
{
71-
72-
}
73-
74-
/**
75-
* Disable the extention
76-
*
77-
* @return unknown_type
78-
*/
79-
public function disable_extension()
80-
{
81-
$this->EE->db->delete('extensions', array('class'=>get_class($this)));
82-
}
83-
}
1+
<?php
2+
require_once 'ab_common'.EXT;
3+
4+
/**
5+
* Base for extensions
6+
*
7+
*/
8+
9+
class Ab_ExtBase extends Ab_Common
10+
{
11+
public $settings = array();
12+
protected $register_hooks; // array of hooks => methods to register
13+
14+
public function __construct($settings='')
15+
{
16+
parent::__construct(); // run constructor which will handle get_instance() etc.
17+
$this->settings = $settings;
18+
}
19+
20+
/**
21+
* Activate the extension
22+
*
23+
* This funciton is run on install and will register all hooks and
24+
* add custom member fields.
25+
*
26+
*/
27+
public function activate_extension()
28+
{
29+
// -------------------------------------------------
30+
// Register the hooks needed for this extension
31+
// -------------------------------------------------
32+
33+
$class_name = get_class($this);
34+
foreach($this->register_hooks as $hook => $method)
35+
{
36+
$data = array(
37+
'class' => $class_name,
38+
'method' => $method,
39+
'hook' => $hook,
40+
'settings' => "",
41+
'priority' => 10,
42+
'version' => $this->version,
43+
'enabled' => "y"
44+
);
45+
$this->EE->db->insert('extensions', $data);
46+
}
47+
}
48+
49+
/**
50+
* Update the extension
51+
*
52+
* @param $current current version number
53+
* @return boolean indicating whether or not the extension was updated
54+
*/
55+
public function update_extension($current='')
56+
{
57+
if ($current == '' OR $current == $this->version)
58+
{
59+
return FALSE;
60+
}
61+
62+
return FALSE;
63+
// update code if version differs here
64+
}
65+
66+
/**
67+
* Settings
68+
*/
69+
public function settings()
70+
{
71+
72+
}
73+
74+
/**
75+
* Disable the extention
76+
*
77+
* @return unknown_type
78+
*/
79+
public function disable_extension()
80+
{
81+
$this->EE->db->delete('extensions', array('class'=>get_class($this)));
82+
}
83+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<?php
2-
require_once 'ab_common'.EXT;
3-
4-
/**
5-
* AddonBakery - Base for EE libraries; all libraries extend this
6-
*
7-
* All your base are belongs to us
8-
*/
9-
1+
<?php
2+
require_once 'ab_common'.EXT;
3+
4+
/**
5+
* AddonBakery - Base for EE libraries; all libraries extend this
6+
*
7+
* All your base are belongs to us
8+
*/
9+
1010
class Ab_LibBase extends Ab_Common {}
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
<?php
2-
require_once 'ab_common'.EXT;
3-
/**
4-
* AddonBakery base for MCP file.
5-
*
6-
* All your base are belongs to us
7-
*/
8-
9-
class Ab_McpBase extends Ab_Common {
10-
11-
const FLASHDATA_MESSAGE_SUCCESS = 'message_success';
12-
const FLASHDATA_MESSAGE_FAILURE = 'message_failure';
13-
14-
public function __construct( $switch = TRUE )
15-
{
16-
parent::__construct();
17-
}
18-
19-
/**
20-
* Display a message to the user (flash)
21-
*
22-
* @param $url url to redirect to
23-
* @param $message the message
24-
* @param string $message_type success/failure?
25-
* @return void
26-
*/
27-
protected function display_message($url, $message, $message_type=Ab_McpBase::FLASHDATA_MESSAGE_SUCCESS)
28-
{
29-
$this->EE->session->set_flashdata($message_type, $message);
30-
$this->EE->functions->redirect($url);
31-
}
1+
<?php
2+
require_once 'ab_common'.EXT;
3+
/**
4+
* AddonBakery base for MCP file.
5+
*
6+
* All your base are belongs to us
7+
*/
8+
9+
class Ab_McpBase extends Ab_Common {
10+
11+
const FLASHDATA_MESSAGE_SUCCESS = 'message_success';
12+
const FLASHDATA_MESSAGE_FAILURE = 'message_failure';
13+
14+
public function __construct( $switch = TRUE )
15+
{
16+
parent::__construct();
17+
}
18+
19+
/**
20+
* Display a message to the user (flash)
21+
*
22+
* @param $url url to redirect to
23+
* @param $message the message
24+
* @param string $message_type success/failure?
25+
* @return void
26+
*/
27+
protected function display_message($url, $message, $message_type=Ab_McpBase::FLASHDATA_MESSAGE_SUCCESS)
28+
{
29+
$this->EE->session->set_flashdata($message_type, $message);
30+
$this->EE->functions->redirect($url);
31+
}
3232
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<?php
2-
require_once 'ab_common'.EXT;
3-
/**
4-
* AddonBakery - base class for UPD file (installer)
5-
*
6-
*/
7-
8-
class Ab_UpdBase extends Ab_Common {
9-
10-
function __construct( $switch = TRUE )
11-
{
12-
parent::__construct();
13-
}
14-
}
1+
<?php
2+
require_once 'ab_common'.EXT;
3+
/**
4+
* AddonBakery - base class for UPD file (installer)
5+
*
6+
*/
7+
8+
class Ab_UpdBase extends Ab_Common {
9+
10+
function __construct( $switch = TRUE )
11+
{
12+
parent::__construct();
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2-
3-
4-
/**
5-
* This is a flag indication whether or not we're currently in PRODUCTION,
6-
* if this is TRUE snippetssync will NOT sync on page load. There's a button
7-
* in addons-> modules -> snippetssync you can click to do a manual sync.
8-
*/
1+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2+
3+
4+
/**
5+
* This is a flag indication whether or not we're currently in PRODUCTION,
6+
* if this is TRUE snippetssync will NOT sync on page load. There's a button
7+
* in addons-> modules -> snippetssync you can click to do a manual sync.
8+
*/
99
$config['snippetssync_production_mode'] = FALSE;

0 commit comments

Comments
 (0)