當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JAXResponse::addAssign方法代碼示例

本文整理匯總了PHP中JAXResponse::addAssign方法的典型用法代碼示例。如果您正苦於以下問題:PHP JAXResponse::addAssign方法的具體用法?PHP JAXResponse::addAssign怎麽用?PHP JAXResponse::addAssign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JAXResponse的用法示例。


在下文中一共展示了JAXResponse::addAssign方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ajaxAddFeatured

 public function ajaxAddFeatured($memberId)
 {
     $objResponse = new JAXResponse();
     CFactory::load('helpers', 'owner');
     $my = CFactory::getUser();
     if ($my->id == 0) {
         return $this->ajaxBlockUnregister();
     }
     if (COwnerHelper::isCommunityAdmin()) {
         $model = CFactory::getModel('Featured');
         if (!$model->isExists(FEATURED_USERS, $memberId)) {
             CFactory::load('libraries', 'featured');
             $featured = new CFeatured(FEATURED_USERS);
             $member = CFactory::getUser($memberId);
             $featured->add($memberId, $my->id);
             $objResponse->addAssign('cWindowContent', 'innerHTML', JText::sprintf('CC MEMBER IS FEATURED', $member->getDisplayName()));
         } else {
             $objResponse->addAssign('cWindowContent', 'innerHTML', JText::_('CC USER ALREADY FEATURED'));
         }
     } else {
         $objResponse->addAssign('cWindowContent', 'innerHTML', JText::_('CC NOT ALLOWED TO ACCESS SECTION'));
     }
     $buttons = '<input type="button" class="button" onclick="window.location.reload();" value="' . JText::_('CC BUTTON CLOSE') . '"/>';
     $objResponse->addScriptCall('cWindowActions', $buttons);
     return $objResponse->sendResponse();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:26,代碼來源:search.php

示例2: ajaxResetNotification

 public function ajaxResetNotification($params)
 {
     $response = new JAXResponse();
     if (!COwnerHelper::isCommunityAdmin()) {
         $response->addAssign('notification-update-result', 'innerHTML', JText::_('COM_COMMUNITY_NOT_ALLOWED'));
         return $response->sendResponse();
     }
     $model = $this->getModel('Configuration');
     $model->updateNotification($params);
     $response->addAssign('notification-update-result', 'innerHTML', JText::_('COM_COMMUNITY_FRONTPAGE_ALL_NOTIFICATION_RESET'));
     $response->addScriptCall("joms.jQuery('#notification-update-result').parent().find('input').val('" . JText::_('COM_COMMUNITY_CONFIGURATION_PRIVACY_RESET_EXISTING_NOTIFICATION_BUTTON') . "');");
     return $response->sendResponse();
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:13,代碼來源:configuration.php

示例3: ajaxEmailPage

 public function ajaxEmailPage($uri, $emails, $message = '')
 {
     $message = stripslashes($message);
     $mainframe =& JFactory::getApplication();
     $bookmarks = CFactory::getBookmarks($uri);
     $mailqModel = CFactory::getModel('mailq');
     $config = CFactory::getConfig();
     $response = new JAXResponse();
     if (empty($emails)) {
         $content = '<div>' . JText::_('CC SHARE INVALID EMAIL') . '</div>';
         $buttons = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('CC BUTTON GO BACK') . '"/>';
     } else {
         $emails = explode(',', $emails);
         $errors = array();
         // Add notification
         CFactory::load('libraries', 'notification');
         foreach ($emails as $email) {
             $email = JString::trim($email);
             if (!empty($email) && preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$/i", $email)) {
                 $params = new JParameter('');
                 $params->set('uri', $uri);
                 $params->set('message', $message);
                 CNotificationLibrary::add('system.bookmarks.email', '', $email, JText::sprintf('CC SHARE EMAIL SUBJECT', $config->get('sitename')), '', 'bookmarks', $params);
             } else {
                 // If there is errors with email, inform the user.
                 $errors[] = $email;
             }
         }
         if ($errors) {
             $content = '<div>' . JText::_('CC EMAILS ARE INVALID') . '</div>';
             foreach ($errors as $error) {
                 $content .= '<div style="font-weight:700;color: red;">' . $error . '</span>';
             }
             $buttons = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('CC BUTTON GO BACK') . '"/>';
         } else {
             $content = '<div>' . JText::_('CC EMAIL SENT TO RECIPIENTS') . '</div>';
             $buttons = '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('CC BUTTON DONE') . '"/>';
         }
     }
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('CC SHARE THIS'));
     $response->addAssign('cWindowContent', 'innerHTML', $content);
     $response->addScriptCall('cWindowActions', $buttons);
     $response->addScriptCall('cWindowResize', 100);
     return $response->sendResponse();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:45,代碼來源:bookmarks.php

示例4: ajaxLoadTemplateFile

 /**
  * Ajax method to load a template file
  *
  * @param	$templateName	The template name
  * @param	$fileName	The file name
  **/
 function ajaxLoadTemplateFile($templateName, $fileName, $override)
 {
     $response = new JAXResponse();
     if ($fileName == 'none') {
         $response->addScriptCall('azcommunity.resetTemplateForm();');
     } else {
         $filePath = COMMUNITY_BASE_PATH . DS . 'templates' . DS . JString::strtolower($templateName) . DS . JString::strtolower($fileName);
         if ($override) {
             $filePath = JPATH_ROOT . DS . 'templates' . DS . JString::strtolower($templateName) . DS . 'html' . DS . 'com_community' . DS . JString::strtolower($fileName);
         }
         jimport('joomla.filesystem.file');
         $contents = JFile::read($filePath);
         $response->addAssign('data', 'value', $contents);
         $response->addAssign('fileName', 'value', $fileName);
         $response->addAssign('templateName', 'value', $templateName);
         $response->addAssign('filePath', 'innerHTML', $filePath);
     }
     return $response->sendResponse();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:25,代碼來源:templates.php

示例5: ajaxResetPrivacy

 public function ajaxResetPrivacy($photoPrivacy = 0, $profilePrivacy = 0, $friendsPrivacy = 0)
 {
     $response = new JAXResponse();
     CFactory::load('helpers', 'owner');
     if (!COwnerHelper::isCommunityAdmin()) {
         $response->addScriptCall(JText::_('COM_COMMUNITY_NOT_ALLOWED'));
         return $response->sendResponse();
     }
     $model = $this->getModel('Configuration');
     $model->updatePrivacy($photoPrivacy, $profilePrivacy, $friendsPrivacy);
     $response->addAssign('privacy-update-result', 'innerHTML', JText::_('COM_COMMUNITY_FRONTPAGE_ALL_PRIVACY_RESET'));
     return $response->sendResponse();
 }
開發者ID:Simarpreet05,項目名稱:joomla,代碼行數:13,代碼來源:configuration.php

示例6: ajaxEmailPage

 public function ajaxEmailPage($uri, $emails, $message = '')
 {
     $filter = JFilterInput::getInstance();
     $uri = $filter->clean($uri, 'string');
     $emails = $filter->clean($emails, 'string');
     $message = $filter->clean($message, 'string');
     $message = stripslashes($message);
     $mainframe =& JFactory::getApplication();
     $bookmarks = CFactory::getBookmarks($uri);
     $mailqModel = CFactory::getModel('mailq');
     $config = CFactory::getConfig();
     $response = new JAXResponse();
     if (empty($emails)) {
         $content = '<div>' . JText::_('COM_COMMUNITY_SHARE_INVALID_EMAIL') . '</div>';
         $actions = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_GO_BACK_BUTTON') . '"/>';
     } else {
         $emails = explode(',', $emails);
         $errors = array();
         // Add notification
         CFactory::load('libraries', 'notification');
         foreach ($emails as $email) {
             $email = JString::trim($email);
             CFactory::load('helpers', 'validate');
             if (!empty($email) && CValidateHelper::email($email)) {
                 $params = new CParameter('');
                 $params->set('uri', $uri);
                 $params->set('message', $message);
                 CNotificationLibrary::add('etype_system_bookmarks_email', '', $email, JText::sprintf('COM_COMMUNITY_SHARE_EMAIL_SUBJECT', $config->get('sitename')), '', 'bookmarks', $params);
             } else {
                 // If there is errors with email, inform the user.
                 $errors[] = $email;
             }
         }
         if ($errors) {
             $content = '<div>' . JText::_('COM_COMMUNITY_EMAILS_ARE_INVALID') . '</div>';
             foreach ($errors as $error) {
                 $content .= '<div style="font-weight:700;color: red;">' . $error . '</span>';
             }
             $actions = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_GO_BACK_BUTTON') . '"/>';
         } else {
             $content = '<div>' . JText::_('COM_COMMUNITY_EMAIL_SENT_TO_RECIPIENTS') . '</div>';
             $actions = '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('COM_COMMUNITY_DONE_BUTTON') . '"/>';
         }
     }
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('COM_COMMUNITY_SHARE_THIS'));
     $response->addScriptCall('cWindowAddContent', $content, $actions);
     return $response->sendResponse();
 }
開發者ID:Simarpreet05,項目名稱:joomla,代碼行數:48,代碼來源:bookmarks.php

示例7: ajaxIphoneInbox

 public function ajaxIphoneInbox()
 {
     $objResponse = new JAXResponse();
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $view = $this->getView('inbox', '', $viewType);
     $html = '';
     ob_start();
     $this->display();
     $content = ob_get_contents();
     ob_end_clean();
     $tmpl = new CTemplate();
     $tmpl->set('toolbar_active', 'inbox');
     $simpleToolbar = $tmpl->fetch('toolbar.simple');
     $objResponse->addAssign('social-content', 'innerHTML', $simpleToolbar . $content);
     return $objResponse->sendResponse();
 }
開發者ID:Jougito,項目名稱:DynWeb,代碼行數:17,代碼來源:inbox.php

示例8: ajaxTogglePublish

 function ajaxTogglePublish($id, $type)
 {
     $user =& JFactory::getUser();
     // @rule: Disallow guests.
     if ($user->get('guest')) {
         JError::raiseError(403, JText::_('CC ACCESS FORBIDDEN'));
         return;
     }
     $response = new JAXResponse();
     // Load the JTable Object.
     $row =& JTable::getInstance('MultiProfile', 'CTable');
     $row->load($id);
     $row->publish($row->id, (int) (!$row->published));
     $row->load($id);
     $image = $row->published ? 'publish_x.png' : 'tick.png';
     $view =& $this->getView('multiprofile', 'html');
     $html = $view->getPublish($row, 'published', 'multiprofile,ajaxTogglePublish');
     $response->addAssign($type . $id, 'innerHTML', $html);
     return $response->sendResponse();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:20,代碼來源:multiprofile.php

示例9: ajaxEditRelations

 function ajaxEditRelations($listing_id, $cat_id = '', $single_select = 0)
 {
     $objResponse = new JAXResponse();
     if (is_numeric($listing_id)) {
         JRequest::setVar('listing_id', $listing_id);
     }
     if ($cat_id) {
         JRequest::setVar('cat', $cat_id);
     }
     if ($single_select) {
         JRequest::setVar('ss', $single_select);
     }
     JRequest::setVar('view', 'edit');
     JFactory::getDocument()->setType('html');
     ob_start();
     $this->display();
     $html = ob_get_contents();
     ob_end_clean();
     $objResponse->addAssign('cWindowContent', 'innerHTML', $html);
     $objResponse->addScriptCall('cWindowResize', 395);
     $objResponse->addScriptCall('_initEditRelations', $listing_id, $cat_id, $single_select);
     return $objResponse->sendResponse();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:23,代碼來源:controller.php

示例10: ajaxRestrictBlockAdmin

 /**
  * restrict user to block community admin
  */
 public function ajaxRestrictBlockAdmin()
 {
     $config = CFactory::getConfig();
     $response = new JAXResponse();
     $buttons = '<form name="jsform-profile-ajaxblockuser" method="post" action="" style="float:right;">';
     $buttons .= '<input type="button" class="button" onclick="cWindowHide();return false;" name="cancel" value="' . JText::_('CC BUTTON CLOSE') . '" />';
     $buttons .= '</form>';
     $response->addAssign('cWindowContent', 'innerHTML', JText::_('CC CANNOT BLOCK COMMUNITY ADMIN'));
     $response->addScriptCall('joms.jQuery("#cwin_logo").html("' . $config->get('sitename') . '");');
     $response->addScriptCall('cWindowActions', $buttons);
     $response->sendResponse();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:15,代碼來源:controller.php

示例11: ajaxEditCategory


//.........這裏部分代碼省略.........
        $row->name = CStringHelper::escape($row->name);
        $row->description = CStringHelper::escape($row->description);
        ob_start();
        ?>

		<div class="alert notice">
			<?php 
        echo JText::_('COM_COMMUNITY_GROUPS_CATEGORY_DESC');
        ?>
		</div>

		<form action="#" method="post" name="editGroupCategory" id="editGroupCategory">
		<table cellspacing="0" class="admintable" border="0" width="100%">
			<tbody>
				<tr>
					<td class="key" width="150" ><span class="js-tooltip"  title="<?php 
        echo JText::_('COM_COMMUNITY_PARENT_TIPS');
        ?>
"><?php 
        echo JText::_('COM_COMMUNITY_PARENT');
        ?>
</span></td>
					<td>
					    <select name="parent">
						    <option value="<?php 
        echo COMMUNITY_NO_PARENT;
        ?>
"><?php 
        echo JText::_('COM_COMMUNITY_NO_PARENT');
        ?>
</option>
						    <?php 
        for ($i = 0; $i < count($categories); $i++) {
            if ($categories[$i]->id != $id && !in_array($categories[$i]->id, $children)) {
                $selected = $row->parent == $categories[$i]->id ? ' selected="selected"' : '';
                ?>
						    <option value="<?php 
                echo $categories[$i]->id;
                ?>
"<?php 
                echo $selected;
                ?>
><?php 
                echo $categories[$i]->name;
                ?>
</option>
						    <?php 
            }
        }
        ?>
					    </select>
					</td>
				</tr>
				<tr>
					<td class="key"><span class="js-tooltip"  title="<?php 
        echo JText::_('COM_COMMUNITY_NAME_CATEGORY_TIPS');
        ?>
"><?php 
        echo JText::_('COM_COMMUNITY_NAME');
        ?>
</span></td>
					<td><input type="text" name="name" size="35" value="<?php 
        echo $id ? $row->name : '';
        ?>
" /></td>
				</tr>
				<tr>
					<td class="key"><span class="js-tooltip"  title="<?php 
        echo JText::_('COM_COMMUNITY_DESC_CATEGORY_TIPS');
        ?>
"><?php 
        echo JText::_('COM_COMMUNITY_DESCRIPTION');
        ?>
</span></td>
					<td>
						<textarea name="description" rows="5" cols="30"><?php 
        echo $id ? $row->description : '';
        ?>
</textarea>
					</td>
				</tr>
			</tbody>

			<input type="hidden" name="id" value="<?php 
        echo $id ? $row->id : 0;
        ?>
" />
		</table>
		</form>

<?php 
        $contents = ob_get_contents();
        ob_end_clean();
        $buttons = '<input type="button" class="btn btn-small btn-primary pull-right" onclick="javascript:azcommunity.saveGroupCategory();return false;" value="' . JText::_('COM_COMMUNITY_SAVE') . '"/>';
        $buttons .= '<input type="button" class="btn btn-small pull-left" onclick="javascript:cWindowHide();" value="' . JText::_('COM_COMMUNITY_CANCEL') . '"/>';
        $this->cacheClean(array(COMMUNITY_CACHE_TAG_GROUPS_CAT));
        $response->addAssign('cWindowContent', 'innerHTML', $contents);
        $response->addScriptCall('cWindowActions', $buttons);
        return $response->sendResponse();
    }
開發者ID:Jougito,項目名稱:DynWeb,代碼行數:101,代碼來源:groupcategories.php

示例12: ajaxAddPredefined

 /**
  * AJAX method to add predefined activity
  **/
 public function ajaxAddPredefined($key, $message = '')
 {
     $objResponse = new JAXResponse();
     $my = CFactory::getUser();
     $filter = JFilterInput::getInstance();
     $key = $filter->clean($key, 'string');
     $message = $filter->clean($message, 'string');
     CFactory::load('libraries', 'activities');
     CFactory::load('helpers', 'owner');
     if (!COwnerHelper::isCommunityAdmin()) {
         return;
     }
     // Predefined system custom activity.
     $system = array('system.registered', 'system.populargroup', 'system.totalphotos', 'system.popularprofiles', 'system.popularphotos', 'system.popularvideos');
     $act = new stdClass();
     $act->actor = $my->id;
     $act->target = 0;
     $act->app = 'system';
     $act->access = PRIVACY_FORCE_PUBLIC;
     $params = new CParameter('');
     if (in_array($key, $system)) {
         switch ($key) {
             case 'system.registered':
                 CFactory::load('helpers', 'time');
                 $usersModel = CFactory::getModel('user');
                 $now = new JDate();
                 $date = CTimeHelper::getDate();
                 $title = JText::sprintf('COM_COMMUNITY_TOTAL_USERS_REGISTERED_THIS_MONTH_ACTIVITY_TITLE', $usersModel->getTotalRegisteredByMonth($now->toFormat('%Y-%m')), $date->_monthToString($now->toFormat('%m')));
                 $act->cmd = 'system.registered';
                 $act->title = $title;
                 $act->content = '';
                 break;
             case 'system.populargroup':
                 $groupsModel = CFactory::getModel('groups');
                 $activeGroup = $groupsModel->getMostActiveGroup();
                 $title = JText::sprintf('COM_COMMUNITY_MOST_POPULAR_GROUP_ACTIVITY_TITLE', $activeGroup->name);
                 $params->set('action', 'groups.join');
                 $params->set('group_url', CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id));
                 $act->cmd = 'groups.popular';
                 $act->cid = $activeGroup->id;
                 $act->title = $title;
                 break;
             case 'system.totalphotos':
                 $photosModel = CFactory::getModel('photos');
                 $total = $photosModel->getTotalSitePhotos();
                 $params->set('photos_url', CRoute::_('index.php?option=com_community&view=photos'));
                 $act->cmd = 'photos.total';
                 $act->title = JText::sprintf('COM_COMMUNITY_TOTAL_PHOTOS_ACTIVITY_TITLE', $total);
                 break;
             case 'system.popularprofiles':
                 CFactory::load('libraries', 'tooltip');
                 $act->cmd = 'members.popular';
                 $act->title = JText::sprintf('COM_COMMUNITY_ACTIVITIES_TOP_PROFILES', 5);
                 $params->set('action', 'top_users');
                 $params->set('count', 5);
                 break;
             case 'system.popularphotos':
                 $act->cmd = 'photos.popular';
                 $act->title = JText::sprintf('COM_COMMUNITY_ACTIVITIES_TOP_PHOTOS', 5);
                 $params->set('action', 'top_photos');
                 $params->set('count', 5);
                 break;
             case 'system.popularvideos':
                 $act->cmd = 'videos.popular';
                 $act->title = JText::sprintf('COM_COMMUNITY_ACTIVITIES_TOP_VIDEOS', 5);
                 $params->set('action', 'top_videos');
                 $params->set('count', 5);
                 break;
         }
     } else {
         // For additional custom activities, we only take the content passed by them.
         if (!empty($message)) {
             CFactory::load('helpers', 'string');
             $message = CStringHelper::escape($message);
             $app = explode('.', $key);
             $app = isset($app[0]) ? $app[0] : 'system';
             $act->title = JText::_($message);
             $act->app = $app;
         }
     }
     $this->cacheClean(array(COMMUNITY_CACHE_TAG_ACTIVITIES));
     // Allow comments on all these
     $act->comment_id = CActivities::COMMENT_SELF;
     $act->comment_type = $key;
     // Allow like for all admin activities
     $act->like_id = CActivities::LIKE_SELF;
     $act->like_type = $key;
     // Add activity logging
     CActivityStream::add($act, $params->toString());
     $objResponse->addAssign('activity-stream-container', 'innerHTML', $this->_getActivityStream());
     $objResponse->addScriptCall("joms.jQuery('.jomTipsJax').addClass('jomTips');");
     $objResponse->addScriptCall('joms.tooltip.setup();');
     return $objResponse->sendResponse();
 }
開發者ID:Simarpreet05,項目名稱:joomla,代碼行數:97,代碼來源:activities.php

示例13: ajaxCheckVersion

    function ajaxCheckVersion()
    {
        $response = new JAXResponse();
        $data = $this->_getCurrentVersionData();
        ob_start();
        // Get the current build number
        $build = $this->_getLocalBuildNumber();
        $version = $this->_getLocalVersionNumber();
        // Test versions
        if ($version < $data->version || $version <= $data->version && $build < $data->build) {
            ?>
		<div>
			<fieldset>
				<legend><?php 
            echo JText::_('CC UPDATE SUMMARY');
            ?>
				<div style="color: red"><?php 
            echo JText::_('CC YOU ARE CURRENTLY RUNNING ON AN OLDER VERSION OF JOM SOCIAL');
            ?>
</div>
				<div style="margin: 3px;"><?php 
            echo JText::sprintf('Version installed: <span style="font-weight:700; color: red">%1$s</strong>', $this->_getLocalVersionString());
            ?>
</div>
				<div style="margin: 3px;"><?php 
            echo JText::sprintf('Latest version available: <span style="font-weight:700;">%1$s</span>', $data->version . '.' . $data->build);
            ?>
</div>
			</fieldset>
			<div style="margin: 10px 3px 3px 3px;">
				<?php 
            echo JText::sprintf('View full changelog at <a href="%1$s" target="_blank">%2$s</a>', $data->changelogURL, $data->changelogURL);
            ?>
			</div>
			<div style="margin: 3px;">
				<?php 
            echo JText::sprintf('View the upgrade instructions at <a href="%1$s" target="_blank">%2$s</a>', $data->instructionURL, $data->instructionURL);
            ?>
			</div>
		</div>
<?php 
        } else {
            ?>
		<div>
			<fieldset>
				<legend><?php 
            echo JText::_('CC UPDATE SUMMARY');
            ?>
				<div style="margin: 3px"><?php 
            echo JText::_('CC YOU ARE CURRENTLY RUNNING THE LATEST VERSION OF JOM SOCIAL');
            ?>
</div>
				<div style="margin: 3px;"><?php 
            echo JText::sprintf('Version installed: <span style="font-weight:700;">%1$s</strong>', $this->_getLocalVersionString());
            ?>
</div>
			</fieldset>
		</div>
<?php 
            $response->addScriptCall('cWindowResize', 160);
        }
        $contents = ob_get_contents();
        ob_end_clean();
        $response->addAssign('cWindowContent', 'innerHTML', $contents);
        $action = '<input type="button" class="button" onclick="cWindowHide();" name="' . JText::_('CC CLOSE') . '" value="' . JText::_('CC CLOSE') . '" />';
        $response->addScriptCall('cWindowActions', $action);
        return $response->sendResponse();
    }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:68,代碼來源:about.php

示例14: ajaxBrowse

 public function ajaxBrowse($position = 'content')
 {
     $filter = JFilterInput::getInstance();
     $position = $filter->clean($position, 'string');
     // Get the proper views and models
     $view = CFactory::getView('apps');
     $appsModel = CFactory::getModel('apps');
     $my = CFactory::getUser();
     $data = new stdClass();
     // Check permissions
     if ($my->id == 0) {
         return $this->blockUnregister();
     }
     // Get the application listing
     $apps = $appsModel->getAvailableApps(false);
     $realApps = array();
     for ($i = 0; $i < count($apps); $i++) {
         $app =& $apps[$i];
         // Hide wall apps
         if (!$appsModel->isAppUsed($my->id, $app->name) && $app->coreapp != '1' && $app->name != 'walls') {
             $app->position = $position;
             $realApps[] = $app;
         }
     }
     $data->applications = $realApps;
     $objResponse = new JAXResponse();
     $html = $view->get('ajaxBrowse', $data);
     $objResponse->addAssign("cwin_logo", 'innerHTML', JText::_('COM_COMMUNITY_APPS_BROWSE'));
     $objResponse->addScriptCall('cWindowAddContent', $html);
     return $objResponse->sendResponse();
 }
開發者ID:Simarpreet05,項目名稱:joomla,代碼行數:31,代碼來源:apps.php

示例15: ajaxCheckVersion

    public function ajaxCheckVersion()
    {
        $response = new JAXResponse();
        $communityController = new CommunityController();
        $stableVersion = $communityController->_getCurrentVersionData();
        $localVersion = $communityController->_getLocalVersionNumber();
        $data = $this->_getCurrentVersionData();
        //this is only used to get the links for change log and update instructions
        ob_start();
        if ($stableVersion) {
            // Test versions
            if (version_compare($localVersion, $stableVersion->version, '<')) {
                ?>

                    <h5><?php 
                echo JText::_('COM_COMMUNITY_UPDATE_SUMMARY');
                ?>
</h5>
                    <div style="color: red"><?php 
                echo JText::_('COM_COMMUNITY_OLDER_VERSION_OF_JOM_SOCIAL');
                ?>
</div>
                    <div><?php 
                echo JText::sprintf('Version installed: <span style="font-weight:700; color: red">%1$s</span>', $this->_getLocalVersionString());
                ?>
</div>
                    <div><?php 
                echo JText::sprintf('Latest version available: <span style="font-weight:700;">%1$s</span>', $stableVersion->version);
                ?>
</div>
                    <div><?php 
                echo JText::sprintf('View full changelog at <a href="%1$s" target="_blank">%2$s</a>', $data->changelogURL, $data->changelogURL);
                ?>
</div>
                    <div><?php 
                echo JText::sprintf('View the upgrade instructions at <a href="%1$s" target="_blank">%2$s</a>', $data->instructionURL, $data->instructionURL);
                ?>
</div>
                <?php 
            } else {
                ?>
                    <div class="clearfix">
                        <h5><?php 
                echo JText::_('COM_COMMUNITY_UPDATE_SUMMARY');
                ?>
</h5>

                        <div><?php 
                echo JText::_('COM_COMMUNITY_LATEST_VERSION_OF_JOM_SOCIAL');
                ?>
</div>
                        <div><?php 
                echo JText::sprintf('Version installed: <span style="font-weight:700;">%1$s</span>', $this->_getLocalVersionString());
                ?>
</div>
                    </div>
                <?php 
            }
        } else {
            ?>
                <div
                    style="color: red"><?php 
            echo JText::_('Please enable "allow_url_fopen" to check version');
            ?>
</div>
            <?php 
        }
        $contents = ob_get_contents();
        ob_end_clean();
        $response->addAssign('cWindowContent', 'innerHTML', $contents);
        $action = '<input type="button" class="btn btn-small pull-right" onclick="cWindowHide();" name="' . JText::_('COM_COMMUNITY_CLOSE') . '" value="' . JText::_('COM_COMMUNITY_CLOSE') . '" />';
        $response->addScriptCall('cWindowActions', $action);
        return $response->sendResponse();
    }
開發者ID:Jougito,項目名稱:DynWeb,代碼行數:74,代碼來源:update.php


注:本文中的JAXResponse::addAssign方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。