Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Symphony 4.x #57

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 45 additions & 5 deletions assets/section.oembed.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,55 @@

/**
* CSS for the blueprintsection driver
*
*
* @author nicolas
*/

div.compact label.oembed-other-title {
width:90%;
margin: 0 0 1.5rem 1.5rem;
width: calc(100% - 3rem);
margin: 0 0 0 3rem;
}

.oembed-params-settings {
margin: 0 0 1.5rem 0;
.field-oembed label > div {
margin-top: 2px;
}

.field-oembed label .frame {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}

.field-oembed label .frame > span {
display: none;
}

.field-oembed label .frame > div {
order: 99;
flex-shrink: 0;
width: 100%;
}

.field-oembed label .frame > a {
border-radius: 5px;
color: #fff;
font-size: 1.1rem;
font-style: normal;
text-transform: uppercase;
line-height: 1.6rem;
margin-bottom: 1rem;
padding: 0.5rem 1rem;
border: none;
background: #2f77eb;
cursor: pointer;
}

.field-oembed label .frame > a:hover {
background: #3B3D40;
}

.field-oembed label .frame > a + span + a {
margin-left: 1rem;
}
54 changes: 26 additions & 28 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,21 @@ public function appendJS(Array $context) {
time(),
false
);

return;
}


// section page, new or edit
if($c['driver'] == 'blueprintssections') {
if($c['driver'] == 'blueprintssections' || (isset($c['context']['section_handle']) && in_array($c['context']['page'], array('new', 'edit')))) {

Administration::instance()->Page->addStylesheetToHead(
URL . '/extensions/oembed_field/assets/section.oembed.css',
'screen',
time() + 1,
false
);

return;
}

return;
}


Expand All @@ -103,26 +101,26 @@ public function appendJS(Array $context) {
public function install() {
// pre v1.3.1
$create = FieldOembed::createFieldTable();

// v1.3.1
$unique = FieldOembed::updateFieldTable_Unique();

// v1.3.2
$thumbs = FieldOembed::updateFieldTable_Thumbs();

// v1.4
$params = FieldOembed::updateFieldTable_QueryParams();

// v1.6
$ssl = FieldOembed::updateFieldTable_ForceSSL();

// v1.7.3
$uniqueMedia = FieldOembed::updateFieldTable_UniqueMedia();

return $create && $unique && $thumbs && $params && $ssl && $uniqueMedia;

}

/**
* Creates the table needed for the settings of the field
*/
Expand All @@ -133,45 +131,45 @@ public function update($previousVersion = false) {
if ($ret && version_compare($previousVersion,'1.3.1') == -1) {
// update for unique setting
$ret_unique = FieldOembed::updateFieldTable_Unique();

// set the return value
$ret = $ret_unique;
}

// are we updating from lower than 1.3.2 ?
if ($ret && version_compare($previousVersion, '1.3.2') == -1) {

// update for the thumbs settings
$ret_thumbs = FieldOembed::updateFieldTable_Thumbs();

// v1.4
// update for the params settings
$ret_params = FieldOembed::updateFieldTable_QueryParams();

// update for the driver column && set all drivers as allowed by default
$ret_driver = FieldOembed::updateFieldTable_Driver() &&
FieldOembed::updateFieldData_Driver();

// set the return value
$ret = $ret_thumbs && $ret_params && $ret_driver;
}

// are we updating from lower or equal to 1.4 ?
if ($ret && version_compare($previousVersion, '1.4') < 1) {
// Fixes issue #22
$ret = FieldOembed::updateDataTable_Driver();
}

// are we updating from lower then 1.6 ?
if ($ret && version_compare($previousVersion, '1.6') < 0) {
$ret = FieldOembed::updateFieldTable_ForceSSL();
}

// are we updating from lower then 1.7.3 ?
if ($ret && version_compare($previousVersion, '1.7.3') < 0) {
$ret = FieldOembed::updateFieldTable_UniqueMedia();
}

// are we updating from lower then 1.8 ?
if ($ret && version_compare($previousVersion, '1.8') < 0) {
$ret = FieldOembed::updateFieldTable_UniqueKey();
Expand All @@ -180,19 +178,19 @@ public function update($previousVersion = false) {
if ($ret && version_compare($previousVersion, '1.8') < 0) {
$ret = FieldOembed::updateDataTable_UniqueKey();
}

return $ret;
}

/**
*
* Drops the table needed for the settings of the field
*/
public function uninstall() {
// pre v1.3.2
$field = FieldOembed::deleteFieldTable();

return $field;
}
}

}
48 changes: 26 additions & 22 deletions extension.meta.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension id="oembed_field" status="released" xmlns="http://getsymphony.com/schemas/extension/1.0">
<name>oEmbed Field</name>
<name>Field: oEmbed</name>
<description>Easily embed videos/images from ANY* website that implements the oEmbed format. See http://oembed.com. Supported services:
- **Vimeo**
- **Youtube**
Expand Down Expand Up @@ -50,6 +50,10 @@
<!-- None -->
</dependencies>
<releases>
<release version="2.0.0" date="TBA" min="4.0.0" max="4.x.x" php-min="5.6.x" php-max="7.x.x">
- Update for Symphony 4.x
- Code refactoring for Database and EQFA
</release>
<release version="1.11.3" date="2017-01-16" min="2.5.0" max="2.x.x">
- Fix a PHP warning: CURLOPT are constants
- Fix error in PHP 5.3: curl_strerror is 5.4+
Expand Down Expand Up @@ -157,57 +161,57 @@
- Refactored the request url parameters feature: You can add values to the oEmbed query string
- YouTube driver fix for the shorten domain (part of issue #19)
- Added the `show thumbnails in table` parameter: if disabled, title or url will be used
- Changes between the two branches (master and dev) are now synced
- Changes between the two branches (master and dev) are now synced
</release>
<release version="1.3.2" date="never" min="2.2.3" max="2.2.5">
- **This release has never been stable**
- Minor bug fixes
- Minor bug fixes
- Added the `oembed requests parameters sets` field's setting (issue #11) ([see how it work]) (@deprecated)
- Fixed a lot of typos (thanks @brando)
- Tables now uses utf_8 and MyISAM
- Refactored the drivers: They are now more easy to implement
- Changes between the two branches (master and dev) are now synced
- Changes between the two branches (master and dev) are now synced
</release>
<release version="1.3.1.1" date="2012-02-01" min="2.2.3" max="2.2.5">
- Added the Twitter Driver :) Thanks @briandrum !
</release>
<release version="1.3.1" date="2011-10-16" min="2.2.3" max="2.2.5">
- Added assets for the blueprints>section pages
- Added the 'unique' option - url can now be unique across a section
- Added assets for the blueprints>section pages
- Added the 'unique' option - url can now be unique across a section
- Added Dailymotion, Qik (fix issue #9) and Viddler drivers (thanks Andrew!, pull request #8)
- Improved comments (a lot!)
- Fix a typo (issue #6)
- Added support for image (thumbnail) in table view (do not forget to add those site in JIT)
- Improved comments (a lot!)
- Fix a typo (issue #6)
- Added support for image (thumbnail) in table view (do not forget to add those site in JIT)
- Refactored how the drivers are managed in the ServiceDispatcher (issue #10)

- Public methods to get drivers and drivers names
- Drivers are now all loaded by default
- Drivers filename must now respect the `class.service[a-zA-Z0-9]+.php` regular expression
- Drivers are now listed in section field and publish page
- Drivers are now listed in section field and publish page
</release>
<release version="1.3" date="2011-10-06" min="2.2.3" max="2.2.5">
- Improved error management - Added a ref flag for that in the public method
- Added a method that permit change of the root tag name in the oEmbed response
- Improved error management - Added a ref flag for that in the public method
- Added a method that permit change of the root tag name in the oEmbed response
</release>
<release version="1.2.2" date="2011-09-28" min="2.2.2" max="2.2.5">
<release version="1.2.2" date="2011-09-28" min="2.2.2" max="2.2.5">
- Update the YouTube driver to 1.2 - Fix when the entered url contains a #
</release>
<release version="1.2.1" date="2011-09-08 " min="2.2.2" max="2.2.5">
<release version="1.2.1" date="2011-09-08 " min="2.2.2" max="2.2.5">
- Update the YouTube driver to 1.1 - Fix the width when the field is in the sidebar
</release>
<release version="1.2" date="2011-08-19" min="2.2.2" max="2.2.5">
<release version="1.2" date="2011-08-19" min="2.2.2" max="2.2.5">
- Update for Symphony 2.2.2 compatibility
(do not need to check for the $simulate value as it seems to be always true)
(do not need to check for the $simulate value as it seems to be always true)
</release>
<release version="1.1" date="2011-07-25" min="2.2.2" max="2.2.5">
- Couple of bug fixes
<release version="1.1" date="2011-07-25" min="2.2.2" max="2.2.5">
- Couple of bug fixes
- Adapted the code so oEmbed resources in the sidebar displays correctly
</release>
<release version="1.0.1" date="2011-07-17" min="2.2.2" max="2.2.5">
<release version="1.0.1" date="2011-07-17" min="2.2.2" max="2.2.5">
- Added YouTube
</release>
<release version="1.0" date="2011-07-15" min="2.2.2" max="2.2.5">
<release version="1.0" date="2011-07-15" min="2.2.2" max="2.2.5">
- First release
</release>
</releases>
</extension>
</extension>
Loading