本文整理汇总了PHP中FLBuilderModel::get_services方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::get_services方法的具体用法?PHP FLBuilderModel::get_services怎么用?PHP FLBuilderModel::get_services使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::get_services方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_account_data
/**
* Get the saved data for a specific account.
*
* @since 1.5.4
* @param string $account The account name.
* @return array|bool The account data or false if it doesn't exist.
*/
public function get_account_data($account)
{
$saved_services = FLBuilderModel::get_services();
if (isset($saved_services[$this->id]) && isset($saved_services[$this->id][$account])) {
return $saved_services[$this->id][$account];
}
return false;
}
示例2: render_account_settings
/**
* Render the account settings for a saved connection.
*
* @since 1.5.4
* @param string $service The service id such as "mailchimp".
* @param string $active The name of the active account, if any.
* @return string The account settings markup.
*/
public static function render_account_settings($service, $active = '')
{
ob_start();
$saved_services = FLBuilderModel::get_services();
$settings = new stdClass();
$settings->service_account = $active;
$options = array('' => __('Choose...', 'fl-builder'));
// Build the account select options.
foreach ($saved_services[$service] as $account => $data) {
$options[$account] = $account;
}
$options['add_new_account'] = __('Add Account...', 'fl-builder');
// Render the account select.
FLBuilder::render_settings_field('service_account', array('row_class' => 'fl-builder-service-account-row', 'class' => 'fl-builder-service-account-select', 'type' => 'select', 'label' => __('Account', 'fl-builder'), 'options' => $options, 'preview' => array('type' => 'none')), $settings);
// Render additional service fields if we have a saved account.
if (!empty($active) && isset($saved_services[$service][$active])) {
$post_data = FLBuilderModel::get_post_data();
$module = FLBuilderModel::get_module($post_data['node_id']);
$instance = self::get_service_instance($service);
$response = $instance->render_fields($active, $module->settings);
if (!$response['error']) {
echo $response['html'];
}
}
return ob_get_clean();
}