Skip to content

Commit

Permalink
Release 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
brendo committed Jun 5, 2012
1 parent e0254f3 commit d98dd41
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 106 deletions.
20 changes: 7 additions & 13 deletions README.md
@@ -1,26 +1,20 @@
# Reference Link Field

- Version: 1.3.7
- Version: 1.4
- Author: craig zheng
- Build Date: 9th Feb 2011
- Requirements: Symphony 2.2, Select Box Link 1.19
- Build Date: 5th June 2012
- Requirements: Symphony 2.3, Select Box Link 1.23

Works in a near identical way to the Select Box Link field, except you can choose whether to display the field as a select box or an autocomplete input.

## Overview

An extension of Symphony's Select Box Link Field which adds the option to display the field as an autocomplete input field.

## Installation

1. Upload the 'referencelink' folder in this archive to your Symphony 'extensions' folder.
1. Upload the `/referencelink` folder to your Symphony `/extensions` folder.

2. Enable it by selecting the "Field: Reference Link ", choose Enable from the with-selected menu, then click Apply.
2. Enable it by selecting the "Field: Reference Link", choose Enable from the with-selected menu, then click Apply.

3. You can now add the "Reference Link" field to your sections.

## Usage

- Works in a near identical way to the Select Box Link field, except you can choose whether to display the field as a select box or an autocomplete input.

## Changelog

- **1.3.7** JS/CSS cleanup and namespacing; 2.2 compatibility
25 changes: 12 additions & 13 deletions assets/referencelink.publish.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 29 additions & 34 deletions extension.driver.php
Expand Up @@ -2,19 +2,6 @@

Class extension_referencelink extends Extension{

public function about(){
return array(
'name' => 'Field: Reference Link',
'version' => '1.3.7',
'release-date' => '2011-02-09',
'author' => array(
'name' => 'craig zheng',
'email' => 'craig@symphony-cms.com'
),
'description' => 'Autocomplete-enabled version of Select Box Link.'
);
}

public function getSubscribedDelegates() {
return array(
array(
Expand All @@ -26,21 +13,44 @@ public function getSubscribedDelegates() {
}

public function initializeAdmin($context) {
$page = $context['parent']->Page;
$page = Administration::instance()->Page;
$assets_path = '/extensions/referencelink/assets/';

// load autocomplete JS
$page->addScriptToHead(URL . $assets_path . 'referencelink.publish.js', 900);
if($page instanceof contentPublish) {
$page->addScriptToHead(URL . $assets_path . 'referencelink.publish.js', 900);
$page->addStylesheetToHead(URL . $assets_path . 'referencelink.publish.css', 'screen', 100);
}
}

// load autocomplete styles
$page->addStylesheetToHead(URL . $assets_path . 'referencelink.publish.css', 'screen', 100);
public function install(){
return Symphony::Database()->query("
CREATE TABLE `tbl_fields_referencelink` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`related_field_id` varchar(255) NOT NULL,
`limit` INT(4) UNSIGNED NOT NULL DEFAULT '20',
`field_type` enum('select','autocomplete') NOT NULL default 'select',
`allow_multiple_selection` enum('yes','no') NOT NULL default 'no',
`show_association` enum('yes','no') NOT NULL default 'yes',
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
");
}

public function uninstall(){
Symphony::Database()->query("DROP TABLE `tbl_fields_referencelink`");
return Symphony::Database()->query("DROP TABLE `tbl_fields_referencelink`");
}

public function update($previousVersion){
if(version_compare($previousVersion, '1.4', '<')){
try{
Symphony::Database()->query("ALTER TABLE `tbl_fields_referencelink` ADD COLUMN `show_association` enum('yes','no') NOT NULL default 'yes'");
}
catch(Exception $e){
// Discard
}
}

if(version_compare($previousVersion, '1.3.1', '<')){
try{
Expand Down Expand Up @@ -75,19 +85,4 @@ public function update($previousVersion){
return true;
}

public function install(){
return Symphony::Database()->query(
"CREATE TABLE `tbl_fields_referencelink` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`related_field_id` varchar(255) NOT NULL,
`limit` INT(4) UNSIGNED NOT NULL DEFAULT '20',
`field_type` enum('select','autocomplete') NOT NULL default 'select',
`allow_multiple_selection` enum('yes','no') NOT NULL default 'no',
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
) TYPE=MyISAM;"
);
}

}
11 changes: 9 additions & 2 deletions extension.meta.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension id="referencelink" status="released" xmlns="http://symphony-cms.com/schemas/extension/1.0">
<name>Reference Link field</name>
<name>Field: Reference Link</name>
<description>Autocomplete select box links</description>
<repo type="github">https://github.com/czheng/referencelink</repo>
<url type="discuss">http://symphony-cms.com/discuss/thread/623/</url>
Expand All @@ -13,6 +13,13 @@
</author>
</authors>
<releases>
<release version="1.3.7" date="2011-02-09" min="2.0.5" />
<release version="1.4" date="2012-06-05" min="2.3">
- Symphony 2.3 compatibility
- [#10](https://github.com/symphonists/referencelink/issues/10) Unticking 'Display relationship in linked sections' has no effect
</release>
<release version="1.3.7" date="2011-02-09" min="2.0.5" max="2.2.x">
- Symphony 2.2 compatibility
- JS/CSS cleanup and namespacing
</release>
</releases>
</extension>

0 comments on commit d98dd41

Please sign in to comment.