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


PHP OW类代码示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct('FindWhiteIp');
     $submit = new Submit('search');
     $submit->setValue(OW::getLanguage()->text('watchdog', 'search'));
     $this->addElement($submit);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:find_white_ip.php

示例2: getList

 public function getList($params)
 {
     $data = OW::getEventManager()->call("guests.get_guests_list", array("userId" => OW::getUser()->getId()));
     if (empty($data)) {
         $this->assign("list", array());
         return;
     }
     $idList = array();
     $viewedMap = array();
     $timeMap = array();
     foreach ($data as $item) {
         $idList[] = $item["userId"];
         $viewedMap[$item["userId"]] = $item["viewed"];
         $timeMap[$item["userId"]] = UTIL_DateTime::formatDate($item["timeStamp"]);
     }
     OW::getEventManager()->call("guests.mark_guests_viewed", array("userId" => OW::getUser()->getId(), "guestIds" => $idList));
     $bookmarkList = OW::getEventManager()->call("bookmarks.get_mark_list", array("userId" => OW::getUser()->getId(), "idList" => $idList));
     $bookmarkList = empty($bookmarkList) ? array() : $bookmarkList;
     $avatarList = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList, true, false);
     $onlineMap = BOL_UserService::getInstance()->findOnlineStatusForUserList($idList);
     foreach ($avatarList as $userId => $user) {
         $color = array('r' => '100', 'g' => '100', 'b' => '100');
         if (!empty($user['labelColor'])) {
             $_color = explode(', ', trim($user['labelColor'], 'rgba()'));
             $color = array('r' => $_color[0], 'g' => $_color[1], 'b' => $_color[2]);
         }
         $list[] = array("userId" => $userId, "displayName" => $user["title"], "avatarUrl" => $user["src"], "label" => $user["label"], "labelColor" => $color, "viewed" => $viewedMap[$userId], "online" => $onlineMap[$userId], "bookmarked" => !empty($bookmarkList[$userId]), "time" => $timeMap[$userId]);
     }
     $this->assign("list", $list);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:30,代码来源:guests.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $plugin = OW::getPluginManager()->getPlugin('BASE');
     $this->setTemplate($plugin->getCmpViewDir() . 'console_list_ipc_item.html');
     $this->addClass('ow_invitation_item ow_cursor_default');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:invitation_item.php

示例4: __construct

 public function __construct($ctrl)
 {
     parent::__construct('settings-form');
     $configs = OW::getConfig()->getValues('yncontactimporter');
     $ctrl->assign('configs', $configs);
     $l = OW::getLanguage();
     $miValidator = new IntValidator(1, 999);
     $miValidator->setErrorMessage($l->text('yncontactimporter', 'max_validation_error', array('min' => 1, 'max' => 999)));
     //Contacts per page
     $textField['contact_per_page'] = new TextField('contact_per_page');
     $textField['contact_per_page']->setLabel($l->text('yncontactimporter', 'settings_contact_per_page'))->setValue($configs['contact_per_page'])->addValidator($miValidator)->setRequired(true);
     $this->addElement($textField['contact_per_page']);
     //Maximum invite per times
     $textField['max_invite_per_times'] = new TextField('max_invite_per_times');
     $textField['max_invite_per_times']->setLabel($l->text('yncontactimporter', 'settings_max_invite_per_times'))->setValue($configs['max_invite_per_times'])->addValidator($miValidator)->setRequired(true);
     $this->addElement($textField['max_invite_per_times']);
     //Default invite message
     $textField['default_invite_message'] = new Textarea('default_invite_message');
     $textField['default_invite_message']->setLabel($l->text('yncontactimporter', 'settings_default_invite_message'))->setValue($configs['default_invite_message']);
     $this->addElement($textField['default_invite_message']);
     // Logo width
     $textField['logo_width'] = new TextField('logo_width');
     $textField['logo_width']->setLabel($l->text('yncontactimporter', 'settings_logo_width'))->setValue($configs['logo_width'])->addValidator($miValidator)->setRequired(true);
     $this->addElement($textField['logo_width']);
     // Logo Height
     $textField['logo_height'] = new TextField('logo_height');
     $textField['logo_height']->setLabel($l->text('yncontactimporter', 'settings_logo_height'))->setValue($configs['logo_height'])->addValidator($miValidator)->setRequired(true);
     $this->addElement($textField['logo_height']);
     $submit = new Submit('submit');
     $submit->setValue($l->text('yncontactimporter', 'save_btn_label'));
     $submit->addAttribute('class', 'ow_ic_save ow_positive');
     $this->addElement($submit);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:33,代码来源:settings_form.php

示例5: __construct

 public function __construct($layout, $params)
 {
     parent::__construct();
     if (empty($params['available'])) {
         if (!empty($params['msg'])) {
             $msg = $params['msg'];
         } else {
             $msg = OW::getLanguage()->text('base', 'authorization_failed_feedback');
         }
         $this->assign('authError', $msg);
         return;
     }
     switch ($layout) {
         case 'page':
             $class = ' ow_photoview_info_onpage';
             break;
         default:
             if ((bool) OW::getConfig()->getValue('photo', 'photo_view_classic')) {
                 $class = ' ow_photoview_pint_mode';
             } else {
                 $class = '';
             }
             break;
     }
     $this->assign('class', $class);
     $this->assign('layout', $layout);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:27,代码来源:photo_floatbox.php

示例6: setCustomMetaInfo

 public function setCustomMetaInfo()
 {
     OW::getDocument()->setDescription(null);
     if (OW::getLanguage()->valueExist('base', "local_page_meta_tags_{$this->getDocumentKey()}")) {
         OW::getDocument()->addCustomHeadInfo(OW::getLanguage()->text('base', "local_page_meta_tags_{$this->getDocumentKey()}"));
     }
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:7,代码来源:static_document.php

示例7: __construct

 public function __construct()
 {
     parent::__construct('delete-membership-form');
     $this->setAjaxResetOnSuccess(false);
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlForRoute('membership_delete_type'));
     $lang = OW::getLanguage();
     $typeId = new HiddenField('typeId');
     $typeId->setRequired(true);
     $this->addElement($typeId);
     $newTypeId = new Selectbox('newTypeId');
     $newTypeId->setHasInvitation(false);
     $this->addElement($newTypeId);
     $types = new RadioGroupItemField('type');
     $types->setRequired(true);
     $types->setLabel($lang->text('membership', 'set_membership'));
     $this->addElement($types);
     $this->bindJsFunction(Form::BIND_SUCCESS, "function( data ) {\n                if ( data.result ) {\n                    document.location.reload();\n                }\n            }");
     $script = '$("#btn-confirm-type-delete").click(function(){
         if ( confirm(' . json_encode($lang->text('membership', 'type_delete_confirm')) . ') ) {
              $(this).parents("form:eq(0)").submit();
         }
     });
     ';
     OW::getDocument()->addOnloadScript($script);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:26,代码来源:delete_membership_form.php

示例8: __construct

 public function __construct(BASE_CommentsParams $params, $id, $formName)
 {
     parent::__construct();
     $language = OW::getLanguage();
     $form = new Form($formName);
     $textArea = new Textarea('commentText');
     $textArea->setHasInvitation(true);
     $textArea->setInvitation($language->text('base', 'comment_form_element_invitation_text'));
     $form->addElement($textArea);
     $hiddenEls = array('entityType' => $params->getEntityType(), 'entityId' => $params->getEntityId(), 'displayType' => $params->getDisplayType(), 'pluginKey' => $params->getPluginKey(), 'ownerId' => $params->getOwnerId(), 'cid' => $id, 'commentCountOnPage' => $params->getCommentCountOnPage(), 'isMobile' => 1);
     foreach ($hiddenEls as $name => $value) {
         $el = new HiddenField($name);
         $el->setValue($value);
         $form->addElement($el);
     }
     $submit = new Submit('comment-submit');
     $submit->setValue($language->text('base', 'comment_add_submit_label'));
     $form->addElement($submit);
     $form->setAjax(true);
     $form->setAction(OW::getRouter()->urlFor('BASE_CTRL_Comments', 'addComment'));
     //        $form->bindJsFunction(Form::BIND_SUBMIT, "function(){ $('#comments-" . $id . " .comments-preloader').show();}");
     //        $form->bindJsFunction(Form::BIND_SUCCESS, "function(){ $('#comments-" . $id . " .comments-preloader').hide();}");
     $this->addForm($form);
     OW::getDocument()->addOnloadScript("window.owCommentCmps['{$id}'].initForm('" . $textArea->getId() . "', '" . $submit->getId() . "');");
     $this->assign('form', true);
     $this->assign('id', $id);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:comments_form.php

示例9: index

 public function index(array $params)
 {
     echo "post_call->" . $_POST['post_id'];
     echo "call->" . $params['id'];
     echo "user_id->" . OW::getUser()->getId();
     echo "call";
     die;
     //        if (!$userId = OW::getUser()->getId()) {
     //            throw new AuthenticateException();
     //        }
     //        $page = (!empty($_GET['page']) && intval($_GET['page']) > 0 ) ? $_GET['page'] : 1;
     //        $lang = OW::getLanguage();
     //        $perPage = (int) OW::getConfig()->getValue('base', OW::getPluginManager()->isPluginActive('skadate') ? 'users_on_page' : 'users_count_on_page');
     //        $guests = OCSGUESTS2_BOL_Service::getInstance()->findGuestsForUser($userId, $page, $perPage);
     //        $guestList = array();
     //        if ($guests) {
     //            foreach ($guests as $guest) {
     //                $guestList[$guest->guestId] = array('last_visit' => $lang->text('skapi', 'visited') . ' ' . '<span class="ow_remark">' . $guest->visitTimestamp . '</span>');
     //            }
     //            $itemCount = OCSGUESTS2_BOL_Service::getInstance()->countGuestsForUser($userId);
     //
     //            if (OW::getPluginManager()->isPluginActive('skadate')) {
     //                $cmp = OW::getClassInstance('BASE_CMP_Users', $guestList, array(), $itemCount);
     //            } else {
     //                $guestsUsers = OCSGUESTS2_BOL_Service::getInstance()->findGuestUsers($userId, $page, $perPage);
     //                $cmp = new OCSGUESTS2_CMP_Users($guestsUsers, $itemCount, $perPage, true, $guestList);
     //            }
     //            $this->addComponent('guests', $cmp);
     //        } else {
     //            $this->assign('guests', null);
     //        }
     //        $this->setPageHeading($lang->text('skapi', 'viewed_profile'));
     //        $this->setPageTitle($lang->text('skapi', 'viewed_profile'));
     //  OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'dashboard');
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:35,代码来源:list.php

示例10: smarty_function_text_edit

function smarty_function_text_edit($params, $smarty)
{
    $key = $params['key'];
    unset($params['key']);
    $key = explode('+', $key);
    if (empty($key[0]) || empty($key[1])) {
        return '_INVALID_KEY_';
    }
    $prefix = $key[0];
    $key = $key[1];
    $text = OW::getLanguage()->text($prefix, $key, $params);
    $keyDto = BOL_LanguageService::getInstance()->findKey($prefix, $key);
    if (!$keyDto) {
        return '<span class="ow_red">' . $text . '</span>';
    }
    $script = '$("a.ow_text_edit").click(function(){
        var self=$(this), lang = this.rel.split("+");
        OW.editLanguageKey(lang[0],lang[1], function(e){
            self.text(e.value);     
        });
    });';
    OW::getDocument()->addOnloadScript($script);
    $rel = json_encode($prefix . '+' . $key);
    return '<a href="javascript://" rel=' . $rel . ' class="ow_text_edit">' . $text . '</a>';
}
开发者ID:vazahat,项目名称:dudex,代码行数:25,代码来源:function.text_edit.php

示例11: __construct

 /**
  * @return Constructor.
  */
 public function __construct($groupId)
 {
     parent::__construct();
     $service = GROUPS_BOL_Service::getInstance();
     $groupDto = $service->findGroupById($groupId);
     $group = array('title' => htmlspecialchars($groupDto->title), 'description' => $groupDto->description, 'time' => $groupDto->timeStamp, 'imgUrl' => empty($groupDto->imageHash) ? false : $service->getGroupImageUrl($groupDto), 'url' => OW::getRouter()->urlForRoute('groups-view', array('groupId' => $groupDto->id)), "id" => $groupDto->id);
     $imageUrl = empty($groupDto->imageHash) ? '' : $service->getGroupImageUrl($groupDto);
     OW::getDocument()->addMetaInfo('image', $imageUrl, 'itemprop');
     OW::getDocument()->addMetaInfo('og:image', $imageUrl, 'property');
     $createDate = UTIL_DateTime::formatDate($groupDto->timeStamp);
     $adminName = BOL_UserService::getInstance()->getDisplayName($groupDto->userId);
     $adminUrl = BOL_UserService::getInstance()->getUserUrl($groupDto->userId);
     $js = UTIL_JsGenerator::newInstance()->jQueryEvent('#groups_toolbar_flag', 'click', UTIL_JsGenerator::composeJsString('OW.flagContent({$entity}, {$id}, {$title}, {$href}, "groups+flags", {$ownerId});', array('entity' => GROUPS_BOL_Service::WIDGET_PANEL_NAME, 'id' => $groupDto->id, 'title' => $group['title'], 'href' => $group['url'], 'ownerId' => $groupDto->userId)));
     OW::getDocument()->addOnloadScript($js, 1001);
     $toolbar = array(array('label' => OW::getLanguage()->text('groups', 'widget_brief_info_create_date', array('date' => $createDate))), array('label' => OW::getLanguage()->text('groups', 'widget_brief_info_admin', array('name' => $adminName, 'url' => $adminUrl))));
     if ($service->isCurrentUserCanEdit($groupDto)) {
         $toolbar[] = array('label' => OW::getLanguage()->text('groups', 'edit_btn_label'), 'href' => OW::getRouter()->urlForRoute('groups-edit', array('groupId' => $groupId)));
     }
     if (OW::getUser()->isAuthenticated() && OW::getUser()->getId() != $groupDto->userId) {
         $toolbar[] = array('label' => OW::getLanguage()->text('base', 'flag'), 'href' => 'javascript://', 'id' => 'groups_toolbar_flag');
     }
     $event = new BASE_CLASS_EventCollector('groups.on_toolbar_collect', array('groupId' => $groupId));
     OW::getEventManager()->trigger($event);
     foreach ($event->getData() as $item) {
         $toolbar[] = $item;
     }
     $this->assign('toolbar', $toolbar);
     $this->assign('group', $group);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:32,代码来源:brief_info_content.php

示例12: import

 public function import($params)
 {
     $importDir = $params['importDir'];
     $txtFile = $importDir . 'configs.txt';
     // import configs
     if (file_exists($txtFile)) {
         $string = file_get_contents($txtFile);
         $configs = json_decode($string, true);
     }
     if (!$configs) {
         return;
     }
     $giftService = VIRTUALGIFTS_BOL_VirtualGiftsService::getInstance();
     $giftsDir = $giftService->getGiftUploadDir();
     $tpls = $giftService->getTemplateList();
     if (empty($tpls)) {
         return;
     }
     foreach ($tpls as $tpl) {
         $dto = $tpl['dto'];
         $path = $giftService->getGiftFilePath($dto->id, $dto->uploadTimestamp, $dto->extension);
         $name = str_replace($giftsDir, '', $path);
         $content = file_get_contents($configs['url'] . '/' . $name);
         if (mb_strlen($content)) {
             OW::getStorage()->fileSetContent($path, $content);
         }
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:28,代码来源:import.php

示例13: __construct

 public function __construct(array $aParams)
 {
     parent::__construct();
     //print_r($aParams); exit;
     foreach ($aParams['items'] as $k => $v) {
         $aParams['items'][$k]['media_parent'] = isset($aParams['items'][$k]['media_parent']) ? $aParams['items'][$k]['media_parent'] : '';
         $aParams['items'][$k]['title_decode'] = urldecode($aParams['items'][$k]['title']);
         $aParams['items'][$k]['update_page_param'] = http_build_query(array('service' => $aParams['items'][$k]['provider'], 'media' => 'photo', 'media_parent' => $aParams['items'][$k]['media_parent'], 'extra' => 'aid', 'aid' => $aParams['items'][$k]['aid']));
         //$aParams['items'][$k]['brief_title'] = substr($aParams['items'][$k]['title_decode'], 0, 20);
         $aParams['items'][$k]['status_text'] = OW::getLanguage()->text("ynmediaimporter", 'import_status_' . $aParams['items'][$k]['status']);
         $aParams['items'][$k]['json'] = json_encode($aParams['items'][$k]);
     }
     //print_r($aParams); exit;
     if (isset($aParams['items'])) {
         $this->assign('items', $aParams['items']);
     }
     if (isset($aParams['params'])) {
         $this->assign('params', $aParams['params']);
         $this->assign('params_json', json_encode($aParams['params']));
     }
     if (isset($aParams['item_count'])) {
         $this->assign('item_count', $aParams['item_count']);
     }
     if (isset($aParams['userId'])) {
         $this->assign('userId', $aParams['userId']);
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:album_browse.php

示例14: __construct

 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct('update-question-form');
     $this->setAction(OW::getRouter()->urlFor('OCSFAQ_CTRL_Admin', 'editQuestion'));
     $lang = OW::getLanguage();
     $questionId = new HiddenField('questionId');
     $questionId->setRequired(true);
     $this->addElement($questionId);
     $question = new TextField('question');
     $question->setRequired(true);
     $question->setLabel($lang->text('ocsfaq', 'question'));
     $this->addElement($question);
     $btnSet = array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO, BOL_TextFormatService::WS_BTN_HTML);
     $answer = new WysiwygTextarea('answer', $btnSet);
     $answer->setRequired(true);
     $answer->setLabel($lang->text('ocsfaq', 'answer'));
     $this->addElement($answer);
     $isFeatured = new CheckboxField('isFeatured');
     $isFeatured->setLabel($lang->text('ocsfaq', 'is_featured'));
     $this->addElement($isFeatured);
     $categories = OCSFAQ_BOL_FaqService::getInstance()->getCategories();
     if ($categories) {
         $category = new Selectbox('category');
         foreach ($categories as $cat) {
             $category->addOption($cat->id, $cat->name);
         }
         $category->setLabel($lang->text('ocsfaq', 'category'));
         $this->addElement($category);
     }
     // submit
     $submit = new Submit('update');
     $submit->setValue($lang->text('ocsfaq', 'btn_save'));
     $this->addElement($submit);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:37,代码来源:faq_edit.php

示例15: index

 public function index($params)
 {
     if (OW::getRequest()->isAjax()) {
         exit;
     }
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('base', 'massmailing_unsubscribe'));
     $code = null;
     $userId = null;
     $result = false;
     if (isset($params['code']) && isset($params['id'])) {
         $result = 'confirm';
         if (!empty($_POST['cancel'])) {
             $this->redirect(OW_URL_HOME);
         }
         $code = trim($params['code']);
         $userId = $params['id'];
         $user = $this->userServise->findUserById($userId);
         if ($user !== null) {
             if (md5($user->username . $user->password) === $code) {
                 $result = 'confirm';
                 if (!empty($_POST['confirm'])) {
                     BOL_PreferenceService::getInstance()->savePreferenceValue('mass_mailing_subscribe', false, $user->id);
                     $result = true;
                     OW::getFeedback()->info($language->text('base', 'massmailing_unsubscribe_successful'));
                     $this->redirect(OW_URL_HOME);
                 }
             }
         }
     }
     $this->assign('result', $result);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:32,代码来源:unsubscribe.php


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