forked from Sigsiu-NET/SobiPro
/
field.php
55 lines (50 loc) · 1.72 KB
/
field.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* @version: $Id$
* @package: SobiPro Library
* @author
* Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH
* Email: sobi[at]sigsiu.net
* Url: http://www.Sigsiu.NET
* @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved.
* @license GNU/LGPL Version 3
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
* See http://www.gnu.org/licenses/lgpl.html and http://sobipro.sigsiu.net/licenses.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* $Date$
* $Revision$
* $Author$
* $HeadURL$
*/
defined( 'SOBIPRO' ) || exit( 'Restricted access' );
SPLoader::loadController( 'controller' );
/**
* @author Radek Suski
* @version 1.0
* @created 09-Mar-2009 11:23:22 AM
*/
class SPFieldCtrl extends SPController
{
/** @var string */
protected $nid = '';
/** @var int */
protected $fid = '';
/** @var SPField */
protected $field = null;
public function __construct()
{
}
public function execute()
{
$method = explode( '.', $this->_task );
$this->nid = 'field_' . $method[ 0 ];
$method = 'Proxy' . ucfirst( $method[ 1 ] );
$this->fid = SPFactory::db()
->select( 'fid', 'spdb_field', array( 'nid' => $this->nid, 'section' => Sobi::Section() ) )
->loadResult();
$this->field = SPFactory::Model( 'field' );
$this->field->init( $this->fid );
$this->field->$method();
return true;
}
}