Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Slgoetz committed Mar 26, 2019
1 parent cbeef88 commit 48bd714
Show file tree
Hide file tree
Showing 20 changed files with 198 additions and 1,381 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added resources/.DS_Store
Binary file not shown.
Binary file modified src/.DS_Store
Binary file not shown.
369 changes: 169 additions & 200 deletions src/Conditions.php

Large diffs are not rendered by default.

28 changes: 7 additions & 21 deletions src/assets/ConditionsAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* Conditions
*
* @link http://mobile.everybyte.in/
* @copyright Copyright (c) 2019 Firoz Khan
* @link http://milkshake.studio
* @copyright Copyright (c) 2019 Milkshake Studio
*/

namespace craftconditions\conditions\assets;
Expand All @@ -26,7 +26,7 @@
*
* https://craftcms.com/docs/plugins/introduction
*
* @author Firoz Khan
* @author Milkshake Studio
* @package Conditions
* @since 1.0.11
*
Expand Down Expand Up @@ -81,32 +81,18 @@ public function init()
GarnishAsset::class,
CpAsset::class,
];
$cssFile = 'stylesheets/conditions.css';
$jsFile = 'javascripts/conditions.js';
$manifest = $this->getRevisionManifest();
// define the relative path to CSS/JS files that should be registered with the page
// when this asset bundle is registered

$includeJsFile = $manifest ? $manifest->$jsFile : $jsFile;
$includeCssFile = $manifest ? $manifest->$cssFile : $cssFile;
$cssFile = 'stylesheets/conditions-btest9098.css';
$jsFile = 'javascripts/conditions-atest3dc3r.js';
$this->js = [
$includeJsFile
$jsFile
];

$this->css = [
$includeCssFile
$cssFile
];

parent::init();
}
protected function getRevisionManifest()
{

$manifestPath = __DIR__. '/../resources/manifest.json';
$result = file_get_contents($manifestPath);
return json_decode($result);
// return (IOHelper::fileExists($manifestPath) && $manifest = IOHelper::getFileContents($manifestPath)) ? json_decode($manifest) : false;
}

// Protected Methods
// =========================================================================
Expand Down
4 changes: 2 additions & 2 deletions src/elements/Conditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* conditions on fields
*
* @link http://mobile.everybyte.in/
* @copyright Copyright (c) 2019 W3care
* @link http://milkshake.stidio
* @copyright Copyright (c) 2019 Milkshake Studio
*/

namespace craftconditions\conditions\elements;
Expand Down
52 changes: 0 additions & 52 deletions src/icon-mask.svg

This file was deleted.

52 changes: 0 additions & 52 deletions src/icon.svg

This file was deleted.

11 changes: 5 additions & 6 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* conditions on fields
*
* @link http://mobile.everybyte.in/
* @copyright Copyright (c) 2019 W3care
* @link http://milkshake.stidio
* @copyright Copyright (c) 2019 Milkshake Studio
*/

namespace craftconditions\conditions\migrations;
Expand All @@ -25,7 +25,7 @@
* If you need to perform any additional actions on install/uninstall, override the
* safeUp() and safeDown() methods.
*
* @author W3care
* @author Milkshake Studio
* @package Conditions
* @since 1.0.0
*/
Expand Down Expand Up @@ -108,13 +108,12 @@ protected function createTables()
[
'id' => $this->primaryKey(),
'fieldLayoutId' => $this->integer()->notNull(),
'conditionals' => $this->text()->notNull(),
'expressions' => $this->text()->notNull(),
'dateCreated' => $this->dateTime()->notNull(),
'dateUpdated' => $this->dateTime()->notNull(),
'uid' => $this->uid(),
// Custom columns in the table
'siteId' => $this->integer()->notNull()->defaultValue(1),
'some_field' => $this->string(255)->notNull()->defaultValue('')
'some_field' => $this->string(255)->notNull()->defaultValue('')
]
);
}
Expand Down
10 changes: 5 additions & 5 deletions src/models/ConditionalsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* conditions on fields
*
* @link http://mobile.everybyte.in/
* @copyright Copyright (c) 2019 W3care
* @link http://milkshake.stidio
* @copyright Copyright (c) 2019 Milkshake Studio
*/

namespace craftconditions\conditions\models;
Expand All @@ -23,7 +23,7 @@
*
* https://craftcms.com/docs/plugins/models
*
* @author W3care
* @author Milkshake Studio
* @package Conditions
* @since 1.0.0
*/
Expand All @@ -39,7 +39,7 @@ class ConditionalsModel extends Model
*/
public $someAttribute = 'Some Default';
public $fieldLayoutId = 'Some Default';
public $conditionals = 'Some Default';
public $expressions = 'Some Default';

// Public Methods
// =========================================================================
Expand All @@ -66,7 +66,7 @@ protected function defineAttributes()
return array(
'id' => AttributeType::Number,
'fieldLayoutId' => AttributeType::Number,
'conditionals' => AttributeType::Mixed,
'expressions' => AttributeType::Mixed,
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/records/ConditionalsRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* conditions on fields
*
* @link http://mobile.everybyte.in/
* @copyright Copyright (c) 2019 W3care
* @link http://milkshake.stidio
* @copyright Copyright (c) 2019 Milkshake Studio
*/

namespace craftconditions\conditions\records;
Expand All @@ -27,7 +27,7 @@
*
* http://www.yiiframework.com/doc-2.0/guide-db-active-record.html
*
* @author W3care
* @author Milkshake Studio
* @package Conditions
* @since 1.0.0
*/
Expand Down Expand Up @@ -61,7 +61,7 @@ protected function defineAttributes()
{
return array(
'fieldLayoutId' => array(AttributeType::Number),
'conditionals' => array(AttributeType::Mixed),
'expressions' => array(AttributeType::Mixed),
);

}
Expand Down
Binary file added src/resources/.DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion src/resources/icon.svg

This file was deleted.

Binary file added src/resources/javascripts/.DS_Store
Binary file not shown.
Loading

0 comments on commit 48bd714

Please sign in to comment.