Skip to content

Commit 87be79e

Browse files
authored
Merge pull request #930 from GravityPDF/shortcode-refractor
Refractoring the [gravitypdf] shortcode class
2 parents a8f6322 + ec48b50 commit 87be79e

15 files changed

Lines changed: 882 additions & 424 deletions

src/Controller/Controller_Shortcodes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ public function add_filters() {
120120
* @return void
121121
*/
122122
public function add_shortcodes() {
123-
add_shortcode( 'gravitypdf', [ $this->model, 'gravitypdf' ] );
123+
add_shortcode( 'gravitypdf', [ $this->model, 'process' ] );
124124
}
125125
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace GFPDF\Exceptions;
4+
5+
/**
6+
* @package Gravity PDF
7+
* @copyright Copyright (c) 2019, Blue Liquid Designs
8+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9+
* @since 5.2
10+
*/
11+
12+
/* Exit if accessed directly */
13+
if ( ! defined( 'ABSPATH' ) ) {
14+
exit;
15+
}
16+
17+
/*
18+
This file is part of Gravity PDF.
19+
20+
Gravity PDF – Copyright (c) 2019, Blue Liquid Designs
21+
22+
This program is free software; you can redistribute it and/or modify
23+
it under the terms of the GNU General Public License as published by
24+
the Free Software Foundation; either version 2 of the License, or
25+
(at your option) any later version.
26+
27+
This program is distributed in the hope that it will be useful,
28+
but WITHOUT ANY WARRANTY; without even the implied warranty of
29+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30+
GNU General Public License for more details.
31+
32+
You should have received a copy of the GNU General Public License
33+
along with this program; if not, write to the Free Software
34+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35+
*/
36+
37+
class GravityPdfShortcodeEntryIdException extends \Exception {
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace GFPDF\Exceptions;
4+
5+
/**
6+
* @package Gravity PDF
7+
* @copyright Copyright (c) 2019, Blue Liquid Designs
8+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9+
* @since 5.2
10+
*/
11+
12+
/* Exit if accessed directly */
13+
if ( ! defined( 'ABSPATH' ) ) {
14+
exit;
15+
}
16+
17+
/*
18+
This file is part of Gravity PDF.
19+
20+
Gravity PDF – Copyright (c) 2019, Blue Liquid Designs
21+
22+
This program is free software; you can redistribute it and/or modify
23+
it under the terms of the GNU General Public License as published by
24+
the Free Software Foundation; either version 2 of the License, or
25+
(at your option) any later version.
26+
27+
This program is distributed in the hope that it will be useful,
28+
but WITHOUT ANY WARRANTY; without even the implied warranty of
29+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30+
GNU General Public License for more details.
31+
32+
You should have received a copy of the GNU General Public License
33+
along with this program; if not, write to the Free Software
34+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35+
*/
36+
37+
class GravityPdfShortcodePdfConditionalLogicFailedException extends \Exception {
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace GFPDF\Exceptions;
4+
5+
/**
6+
* @package Gravity PDF
7+
* @copyright Copyright (c) 2019, Blue Liquid Designs
8+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9+
* @since 5.2
10+
*/
11+
12+
/* Exit if accessed directly */
13+
if ( ! defined( 'ABSPATH' ) ) {
14+
exit;
15+
}
16+
17+
/*
18+
This file is part of Gravity PDF.
19+
20+
Gravity PDF – Copyright (c) 2019, Blue Liquid Designs
21+
22+
This program is free software; you can redistribute it and/or modify
23+
it under the terms of the GNU General Public License as published by
24+
the Free Software Foundation; either version 2 of the License, or
25+
(at your option) any later version.
26+
27+
This program is distributed in the hope that it will be useful,
28+
but WITHOUT ANY WARRANTY; without even the implied warranty of
29+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30+
GNU General Public License for more details.
31+
32+
You should have received a copy of the GNU General Public License
33+
along with this program; if not, write to the Free Software
34+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35+
*/
36+
37+
class GravityPdfShortcodePdfConfigNotFoundException extends \Exception {
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace GFPDF\Exceptions;
4+
5+
/**
6+
* @package Gravity PDF
7+
* @copyright Copyright (c) 2019, Blue Liquid Designs
8+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9+
* @since 5.2
10+
*/
11+
12+
/* Exit if accessed directly */
13+
if ( ! defined( 'ABSPATH' ) ) {
14+
exit;
15+
}
16+
17+
/*
18+
This file is part of Gravity PDF.
19+
20+
Gravity PDF – Copyright (c) 2019, Blue Liquid Designs
21+
22+
This program is free software; you can redistribute it and/or modify
23+
it under the terms of the GNU General Public License as published by
24+
the Free Software Foundation; either version 2 of the License, or
25+
(at your option) any later version.
26+
27+
This program is distributed in the hope that it will be useful,
28+
but WITHOUT ANY WARRANTY; without even the implied warranty of
29+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30+
GNU General Public License for more details.
31+
32+
You should have received a copy of the GNU General Public License
33+
along with this program; if not, write to the Free Software
34+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35+
*/
36+
37+
class GravityPdfShortcodePdfInactiveException extends \Exception {
38+
}

0 commit comments

Comments
 (0)