HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/biblioteka/wp-content/plugins/form-maker/admin/controllers/FMShortocde.php
<?php

/**
 * Class FMControllerFMShortocde
 */
class FMControllerFMShortocde extends FMAdminController {

  private $model;
  private $view;

  /**
   * FMControllerFMShortocde constructor.
   */
  public function __construct() {
    require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/models/FMShortocde.php";
    $this->model = new FMModelFMShortocde();

    require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/FMShortocde.php";
    $this->view = new FMViewFMShortocde();
  }

  /**
   * Execute.
   */
  public function execute() {
    $task = WDW_FM_Library(self::PLUGIN)->get('task', 'forms', 'sanitize_key');
    $this->display($task);
  }

  /**
   * Display.
   *
   * @param string $task
   */
  public function display( $task = '' ) {
    // Get forms.
    $forms = $this->model->get_form_data();
    if ( method_exists($this->view, $task) ) {
      $this->view->$task($forms);
    }
    else {
      $this->view->forms($forms);
    }
  }
}