-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ef93e28
Showing
8 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.git | ||
*.vscode | ||
package-lock.json | ||
*copy* | ||
|
||
_docs/* | ||
!_docs/to-do.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## 1.0.1: 2019-09-06 | ||
Minor changes | ||
## 1.0.0: 2018-06-23 | ||
Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Installation Instructions | ||
|
||
1. Unzip this file in your site's packages/ directory. | ||
2. Login to your site as an administrator. | ||
3. Find the "Add Functionality" page in your dashboard. | ||
4. Find this package in the list of packages awaiting installation. | ||
5. Click the "install" button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This software is licensed under the terms described in the concrete5.org marketplace. Please find the add-on there for the latest license copy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# [concrete5](https://www.concrete5.org) Clear Clipboard | ||
|
||
A job that clears the entire clipboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* Clear Clipboard | ||
* For concrete5 | ||
* @author Shahroq <shahroq \at\ yahoo.com> | ||
* @copyright Copyright 2018 Shahroq | ||
* @link https://www.concrete5.org/marketplace/addons/clear-clipboard-job | ||
*/ | ||
|
||
namespace Concrete\Package\WhaleClearClipboard; | ||
|
||
defined('C5_EXECUTE') or die('Access denied.'); | ||
|
||
use Concrete\Core\Job\Job; | ||
use Concrete\Core\Package\Package; | ||
|
||
class Controller extends Package | ||
{ | ||
|
||
protected $pkgHandle = 'whale_clear_clipboard'; | ||
protected $appVersionRequired = '5.7.3'; | ||
protected $pkgVersion = '1.0.1'; | ||
|
||
public function getPackageName() | ||
{ | ||
return t("Clear Clipboard"); | ||
} | ||
|
||
public function getPackageDescription() | ||
{ | ||
return t("A job that clears the entire clipboard"); | ||
} | ||
|
||
public function install() | ||
{ | ||
$pkg = parent::install(); | ||
|
||
Job::installByPackage('whale_clear_clipboard', $pkg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
namespace Concrete\Package\WhaleClearClipboard\Job; | ||
|
||
defined('C5_EXECUTE') or die('Access denied.'); | ||
|
||
use Concrete\Core\Job\Job; | ||
use Concrete\Core\Page\Stack\Pile\Pile; | ||
use Concrete\Core\Page\Stack\Pile\PileContent; | ||
|
||
class WhaleClearClipboard extends Job | ||
{ | ||
public function getJobName() | ||
{ | ||
return t("Clear Clipboard"); | ||
} | ||
|
||
public function getJobDescription() | ||
{ | ||
return t("Clear the entire clipboard"); | ||
} | ||
|
||
public function run() | ||
{ | ||
$num = 0; | ||
$sp = (new Pile())->getDefault(); | ||
$contents = $sp->getPileContentObjects('date_asc'); | ||
foreach ($contents as $pile_content) { | ||
$pcID = $pile_content->getPileContentID(); | ||
|
||
$pileContent = PileContent::get($pcID); | ||
$pileContent->delete(); | ||
$num++; | ||
} | ||
return t("%d item(s) removed from the clipboard.", $num); | ||
return true; | ||
} | ||
} |