Пример #1
0
<?php

/*
* @package		Miwi Framework
* @copyright	Copyright (C) 2009-2014 Miwisoft, LLC. All rights reserved.
* @copyright	Copyright (C) 2005-2012 Open Source Matters, Inc. All rights reserved.
* @license		GNU General Public License version 2 or later
*/
defined('MIWI') or die('MIWI');
MFormHelper::loadFieldClass('text');
class MFormFieldTel extends MFormFieldText
{
    protected $type = 'Tel';
}
Пример #2
0
<?php

/*
* @package		Miwi Framework
* @copyright	Copyright (C) 2009-2014 Miwisoft, LLC. All rights reserved.
* @copyright	Copyright (C) 2005-2012 Open Source Matters, Inc. All rights reserved.
* @license		GNU General Public License version 2 or later
*/
defined('MIWI') or die('MIWI');
MFormHelper::loadFieldClass('list');
class MFormFieldEditors extends MFormFieldList
{
    public $type = 'Editors';
    protected function getOptions()
    {
        MLog::add('MFormFieldEditors is deprecated. Use MFormFieldPlugins instead (with folder="editors").', MLog::WARNING, 'deprecated');
        // Get the database object and a new query object.
        $db = MFactory::getDBO();
        $query = $db->getQuery(true);
        // Build the query.
        $query->select('element AS value, name AS text');
        $query->from('#__extensions');
        $query->where('folder = ' . $db->quote('editors'));
        $query->where('enabled = 1');
        $query->order('ordering, name');
        // Set the query and load the options.
        $db->setQuery($query);
        $options = $db->loadObjectList();
        $lang = MFactory::getLanguage();
        foreach ($options as $i => $option) {
            $lang->load('plg_editors_' . $option->value, MPATH_ADMINISTRATOR, null, false, false) || $lang->load('plg_editors_' . $option->value, MPATH_PLUGINS . '/editors/' . $option->value, null, false, false) || $lang->load('plg_editors_' . $option->value, MPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load('plg_editors_' . $option->value, MPATH_PLUGINS . '/editors/' . $option->value, $lang->getDefault(), false, false);
Пример #3
0
<?php

/*
* @package		Miwi Framework
* @copyright	Copyright (C) 2009-2014 Miwisoft, LLC. All rights reserved.
* @copyright	Copyright (C) 2005-2012 Open Source Matters, Inc. All rights reserved.
* @license		GNU General Public License version 2 or later
*/
defined('MIWI') or die('MIWI');
MFormHelper::loadFieldClass('groupedlist');
class MFormFieldTimezone extends MFormFieldGroupedList
{
    protected $type = 'Timezone';
    protected static $zones = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific');
    protected function getGroups()
    {
        // Initialize variables.
        $groups = array();
        $keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'id';
        $keyValue = $this->form->getValue($keyField);
        // If the timezone is not set use the server setting.
        if (strlen($this->value) == 0 && empty($keyValue)) {
            $this->value = MFactory::getConfig()->get('offset');
        }
        // Get the list of time zones from the server.
        $zones = DateTimeZone::listIdentifiers();
        // Build the group lists.
        foreach ($zones as $zone) {
            // Time zones not in a group we will ignore.
            if (strpos($zone, '/') === false) {
                continue;