当前位置: 首页>>代码示例>>PHP>>正文


PHP type::add方法代码示例

本文整理汇总了PHP中type::add方法的典型用法代码示例。如果您正苦于以下问题:PHP type::add方法的具体用法?PHP type::add怎么用?PHP type::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在type的用法示例。


在下文中一共展示了type::add方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hookFormLoad

 /**
  * Хук инициализации формы
  *
  * @param type $Form
  */
 public function hookFormLoad($Form)
 {
     if (access('Parser.off')) {
         if ($this->input->post('parser_off')) {
             Cookie::set('parser_off', TRUE);
         }
         if ($Form->body) {
             $Form->add('parser_off', array('type' => 'checkbox', 'label' => t('Отключить парсер'), 'value' => Cookie::get('parser_off') ? TRUE : FALSE, 'order' => $Form->body->options->order . '.1'));
         }
     }
 }
开发者ID:brussens,项目名称:cogear2,代码行数:16,代码来源:Gear.php

示例2: getPagesForMenu

 /**
  * 
  * @param type $menu
  * @param type $id
  */
 public static function getPagesForMenu($menu, $id)
 {
     $pages = Page::where('parent', '=', $id)->get(['id', 'menu', 'parent', 'title']);
     if ($id == 0) {
         foreach ($pages as $page) {
             $menu->add($page->menu, array('route' => array('oldalak.show', 'id' => $page->id, 'title' => Str::slug($page->title))));
             Page::getPagesForMenu($menu, $page->id);
         }
     } else {
         foreach ($pages as $page) {
             $parent = Page::find($page->parent);
             $menu->get(Str::camel($parent->menu))->add($page->menu, array('route' => array('oldalak.show', 'id' => $page->id, 'title' => Str::slug($page->title))));
             Page::getPagesForMenu($menu, $page->id);
         }
     }
 }
开发者ID:gabemiller,项目名称:project-dv,代码行数:21,代码来源:Page.php

示例3: getDate

 /** Get the date and time and add one hour
  * @access public
  * @return array
  */
 public function getDate()
 {
     $this->_date = new Zend_Date();
     $this->_date->add('1', Zend_Date::HOUR)->toString('YYYY-MM-dd HH:mm:ss');
     return $this->_date;
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:10,代码来源:Yahoo.php

示例4: _addOperationToMenu

 /**
  * Adds html snippet to menu
  * Snippet coresponds to selected operation in context menu 
  * All create***MenuItem method must be implemented by descendant classes
  * @param string $operationName
  * @param type $menu
  * @param type $mediaTrigger
  * @param type $folderItem
  */
 private function _addOperationToMenu($operationName, &$menu, $mediaTrigger, $folderItem)
 {
     switch ($operationName) {
         case 'editTitles':
             $menu->add($this->createTitlesMenuItem($folderItem));
             break;
         case 'renameFile':
             $menu->add($this->createRenameMenuItem($folderItem));
             break;
         case 'insertFile':
             $menu->add($this->createInsertFileToContainerMenuItem($folderItem));
             break;
         case 'deleteFile':
             $menu->add($this->createDeleteFileMenuItem($folderItem));
             break;
         case 'cutFile':
             $menu->add($this->createCutFileMenuItem($folderItem));
             break;
         case 'toggleSelectFile':
             $menu->add($this->createToggleSelectFileMenuItem($folderItem));
             break;
         case 'renameFolder':
             $menu->add($this->createRenameFolderMenuItem($folderItem));
             break;
         case 'deleteFolder':
             $menu->add($this->createDeleteFolderMenuItem($folderItem));
             break;
         case 'cutFolder':
             $menu->add($this->createCutFolderMenuItem($folderItem));
             break;
         case 'renameGallery':
             $menu->add($this->createRenameGalleryMenuItem($folderItem));
             break;
         case 'deleteGallery':
             $menu->add($this->createDeleteGalleryMenuItem($folderItem));
             break;
         case 'insertGallery':
             $menu->add($this->createInsertGalleryMenuItem($mediaTrigger, $folderItem));
             break;
         case 'cutGallery':
             $menu->add($this->createCutGalleryMenuItem($folderItem));
             break;
         case 'sep':
             $menu->add($this->createMenuSeparator());
             break;
     }
 }
开发者ID:jurasm2,项目名称:bubo,代码行数:56,代码来源:AbstractItem.php

示例5: umc_wp_password_reset_check

/**
 * Validate password resets for banned users
 *
 * @param type $errors
 * @param type $user_obj
 */
function umc_wp_password_reset_check($errors, $user_obj)
{
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    require_once '/home/minecraft/server/bin/index_wp.php';
    $check = umc_user_is_banned($user_obj->user_login);
    if ($check) {
        // user is banned
        $errors->add('user_is_banned', 'ERROR: You are banned from this server. Password request denied.');
        XMPP_ERROR_send_msg("Banned User " . $user_obj->user_login . " attempted password reset");
    }
}
开发者ID:dani0010,项目名称:uncovery_me,代码行数:17,代码来源:wordpress_plugin.php

示例6: addProjets

 public function addProjets(Projet $projet)
 {
     if (!$this->projets->contains($projet)) {
         $this->projets->add($projet);
         $projet->setProfile($this);
     }
     return $this;
 }
开发者ID:BenouSophie,项目名称:cvnew,代码行数:8,代码来源:Profile.php

示例7: wangguard_signup_validate

/**
 * Validates security question
 *
 * @param type $user_name
 * @param type $user_email
 * @param type $errors
 */
function wangguard_signup_validate($user_name, $user_email, $errors)
{
    //if ($_POST['user_email']){ $user_email = $_POST['user_email']; }else{ $user_email = $user_email; }
    $wggstopcheck = false;
    do_action('pre_wangguard_validate_signup_form_wordpress_no_multisite', $user_email);
    $wggstopcheck = apply_filters('pre_wangguard_validate_signup_form_wordpress_no_multisite', $wggstopcheck);
    if (!$wggstopcheck) {
        if (!wangguard_validate_hfields($user_email)) {
            $errors->add('user_login', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
            return;
        }
        $answerOK = wangguard_question_repliedOK();
        //If at least a question exists on the questions table, then check the provided answer
        if (!$answerOK) {
            $errors->add('wangguard_error', __('<strong>ERROR</strong>: The answer to the security question is invalid.', 'wangguard'));
        } else {
            //check domain against the list of selected blocked domains
            $blocked = wangguard_is_domain_blocked($user_email);
            if ($blocked) {
                $errors->add('wangguard_error', __('<strong>ERROR</strong>: Domain not allowed.', 'wangguard'));
            } else {
                $reported = wangguard_is_email_reported_as_sp($user_email, wangguard_getRemoteIP(), wangguard_getRemoteProxyIP(), true);
                if ($reported) {
                    $errors->add('wangguard_error', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
                } else {
                    if (wangguard_email_aliases_exists($user_email)) {
                        $errors->add('wangguard_error', __('<strong>ERROR</strong>: Duplicate alias email found by WangGuard.', 'wangguard'));
                    } else {
                        if (!wangguard_mx_record_is_ok($user_email)) {
                            $errors->add('wangguard_error', __("<strong>ERROR</strong>: WangGuard couldn't find an MX record associated with your email domain.", 'wangguard'));
                        }
                    }
                }
            }
        }
    }
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:44,代码来源:wangguard-admin.php

示例8: __construct

 /**
  * Constructor del shortcode per a llistes.
  *
  * @param type $shortcodes_handler gestiona les URL.
  */
 public function __construct($shortcodes_handler = null)
 {
     if ($shortcodes_handler != null) {
         $shortcodes_handler->add('llista-icones', array($this, 'shortcode'), true);
     }
 }
开发者ID:softcatala,项目名称:sc-shortcodes,代码行数:11,代码来源:class-llista-icones.php

示例9: hookMenuAdmin

 /**
  * Добавлени пункта в админ меню
  *
  * @param type $menu
  */
 public function hookMenuAdmin($menu)
 {
     $menu->add(array('label' => icon('fire') . ' ' . t('Код'), 'link' => l('/admin/code'), 'order' => 555));
 }
开发者ID:brussens,项目名称:cogear2,代码行数:9,代码来源:Gear.php

示例10: addValidator

 public function addValidator($validator)
 {
     $this->validators->add($validator);
 }
开发者ID:elymatos,项目名称:expressive_fnbr,代码行数:4,代码来源:MBaseControl.php

示例11: wangguard_signup_validate

/**
 * Validates security question
 * 
 * @param type $user_name
 * @param type $user_email
 * @param type $errors
 */
function wangguard_signup_validate($user_name, $user_email, $errors)
{
    if (!wangguard_validate_hfields($_POST['user_email'])) {
        $errors->add('user_login', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is a mistake?</a>.', 'wangguard'));
        return;
    }
    $answerOK = wangguard_question_repliedOK();
    //If at least a question exists on the questions table, then check the provided answer
    if (!$answerOK) {
        $errors->add('wangguard_error', __('<strong>ERROR</strong>: The answer to the security question is invalid.', 'wangguard'));
    } else {
        //check domain against the list of selected blocked domains
        $blocked = wangguard_is_domain_blocked($_REQUEST['user_email']);
        if ($blocked) {
            $errors->add('wangguard_error', __('<strong>ERROR</strong>: Domain not allowed.', 'wangguard'));
        } else {
            $reported = wangguard_is_email_reported_as_sp($_REQUEST['user_email'], wangguard_getRemoteIP(), wangguard_getRemoteProxyIP(), true);
            if ($reported) {
                $errors->add('wangguard_error', __('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is a mistake?</a>.', 'wangguard'));
            } else {
                if (wangguard_email_aliases_exists($_REQUEST['user_email'])) {
                    $errors->add('wangguard_error', __('<strong>ERROR</strong>: Duplicate alias email found by WangGuard.', 'wangguard'));
                } else {
                    if (!wangguard_mx_record_is_ok($_REQUEST['user_email'])) {
                        $errors->add('wangguard_error', __("<strong>ERROR</strong>: WangGuard couldn't find an MX record associated with your email domain.", 'wangguard'));
                    }
                }
            }
        }
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:38,代码来源:wangguard-admin.php


注:本文中的type::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。