Skip to content

Commit

Permalink
Get started with Github: V1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shahroq committed Sep 6, 2019
0 parents commit ef93e28
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
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
4 changes: 4 additions & 0 deletions CHANGELOG
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
7 changes: 7 additions & 0 deletions INSTALL.TXT
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.
1 change: 1 addition & 0 deletions LICENSE.TXT
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.
3 changes: 3 additions & 0 deletions README.md
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
40 changes: 40 additions & 0 deletions controller.php
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);
}
}
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions jobs/whale_clear_clipboard.php
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;
}
}

0 comments on commit ef93e28

Please sign in to comment.