@@ -34,6 +34,7 @@ function mathilda_tools_controller() {
3434 $ handbook_show =false ;
3535 $ mathilda_reset =false ;
3636 $ import_break =false ;
37+ $ cron_status =false ;
3738
3839 // Load Tweets
3940 if (isset ($ _GET ['cron ' ])) {
@@ -42,6 +43,13 @@ function mathilda_tools_controller() {
4243 $ run_cron =true ;
4344 }
4445 }
46+ // Cron Status
47+ if (isset ($ _GET ['cronstatus ' ])) {
48+ if ($ _GET ['cronstatus ' ]=='true ' )
49+ {
50+ $ cron_status =true ;
51+ }
52+ }
4553 // Scripting
4654 if (isset ($ _GET ['scripting ' ])) {
4755 if ($ _GET ['scripting ' ]=='true ' )
@@ -148,6 +156,8 @@ function mathilda_tools_controller() {
148156function mathilda_tools () {
149157
150158 /* Dynamic Labels */
159+
160+ /* Import Status */
151161 $ label_import_botton ="" ;
152162 $ label_import_status =get_option ('mathilda_import_running ' );
153163 if ($ label_import_status ==0 ) {
@@ -156,6 +166,15 @@ function mathilda_tools() {
156166 $ label_import_botton ="Status! " ;
157167 }
158168
169+ /* cron Status */
170+ $ label_cronstatus_button ="" ;
171+ $ label_cronstatus_status =get_option ('mathilda_cron_status ' );
172+ if ($ label_cronstatus_status ==0 ) {
173+ $ label_cronstatus_button ="Activate! " ;
174+ } else {
175+ $ label_cronstatus_button ="Deactivate! " ;
176+ }
177+
159178 /* Headline */
160179 echo '<h1 class="mathilda_tools_headline">Tweets</h1>
161180 <p class="mathilda_tools_description">Mathilda Tools</p> ' ;
@@ -193,6 +212,27 @@ function mathilda_tools() {
193212 }
194213 }
195214
215+ // Auto Load
216+ if (isset ($ _GET ['cronstatus ' ])) {
217+ if ($ _GET ['cronstatus ' ]=='true ' )
218+ {
219+ $ autoload_status =get_option ('mathilda_cron_status ' );
220+ if ($ autoload_status ) {
221+ update_option ('mathilda_cron_status ' ,'0 ' );
222+ $ label_cronstatus_button ="Activate! " ;
223+ echo '<div class="updated fade">
224+ <p><strong>Auto Load has been deactivated.</strong></p>
225+ </div> ' ;
226+ } else {
227+ update_option ('mathilda_cron_status ' ,'1 ' );
228+ $ label_cronstatus_button ="Deactivate! " ;
229+ echo '<div class="updated fade">
230+ <p><strong>Auto Load has been activated.</strong></p>
231+ </div> ' ;
232+ }
233+ }
234+ }
235+
196236 // Embed Reset
197237 if (isset ($ _GET ['resetisconfirmed ' ])) {
198238 if ($ _GET ['resetisconfirmed ' ]=='true ' )
@@ -226,6 +266,16 @@ function mathilda_tools() {
226266 <a class="button" href=" ' .admin_url ().'tools.php?page=mathilda-tools-menu&cron=true" >Run!</a>
227267 </td>
228268 </tr>
269+
270+ <!-- Status Cron -->
271+ <tr valign="top">
272+ <th scope="row">
273+ <label for="cron">Auto Load</label>
274+ </th>
275+ <td>
276+ <a class="button" href=" ' .admin_url ().'tools.php?page=mathilda-tools-menu&cronstatus=true"> ' .$ label_cronstatus_button .'</a>
277+ </td>
278+ </tr>
229279
230280 <!-- Load Twitter Export -->
231281 <tr valign="top">
0 commit comments