You are here

function theme_sexybookmarks_services in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.2

Same name and namespace in other branches
  1. 7 plugins/export_ui/sexybookmarks_profiles.inc \theme_sexybookmarks_services()
1 theme call to theme_sexybookmarks_services()
sexybookmarks_profiles_export_ui_form in plugins/export_ui/sexybookmarks_profiles.inc
SexyBookmarks profiles settings form.

File

plugins/export_ui/sexybookmarks_profiles.inc, line 443

Code

function theme_sexybookmarks_services($variables) {
  $services_list = array(
    "1" => "Buzzster!",
    "2" => "Delicious",
    "3" => "Digg",
    "4" => "Mixx",
    "5" => "Facebook",
    "6" => "Mister-Wong",
    "7" => "Twitter",
    "8" => "Netlog",
    "9" => "Pownce",
    "10" => "Technorati Favorites",
    "11" => "Furl",
    "12" => "Shoutwire",
    "13" => "CiteULike",
    "14" => "Jumptags",
    "15" => "Windows Live Spaces",
    "16" => "Hemidemi",
    "17" => "FunP",
    "18" => "Instapaper",
    "19" => "PhoneFavs",
    "20" => "Xerpi",
    "21" => "Netvouz",
    "22" => "Wink",
    "23" => "Ma.gnolia",
    "24" => "Diigo",
    "25" => "BibSonomy",
    "26" => "Taggly",
    "27" => "BlogMarks",
    "28" => "Tailrank",
    "29" => "StartAid",
    "30" => "Kledy",
    "31" => "Khabbr",
    "32" => "Yahoo My Web",
    "33" => "Meneame",
    "34" => "Yoolink",
    "35" => "Bookmarks.fr",
    "36" => "Technotizie",
    "37" => "Windows Live Favorites",
    "38" => "StumbleUpon",
    "39" => "MySpace",
    "40" => "Reddit",
    "41" => "NewsVine",
    "42" => "Multiply",
    "43" => "FriendFeed",
    "44" => "Plaxo Pulse",
    "45" => "Ping",
    "46" => "Squidoo",
    "47" => "Protopage Bookmarks",
    "48" => "Blinklist",
    "49" => "Faves",
    "50" => "AIM",
    "51" => "E-mail program",
    "52" => "Gmail",
    "53" => "Hotmail",
    "54" => "Yahoo Mail",
    "55" => "AOL Mail",
    "56" => "YiGG",
    "57" => "Webnews",
    "58" => "Segnalo",
    "59" => "Pusha",
    "60" => "YouMob",
    "61" => "Slashdot",
    "62" => "Fark",
    "63" => "Allvoices",
    "64" => "Jamespot",
    "65" => "Imera Brazil",
    "66" => "Twiddla",
    "67" => "LinkaGoGo",
    "68" => "MindBodyGreen",
    "69" => "Feedmarker Bookmarks",
    "70" => "unalog",
    "71" => "Hugg",
    "72" => "Diglog",
    "73" => "Yahoo Buzz",
    "74" => "Google Bookmarks",
    "75" => "NowPublic",
    "76" => "Yahoo Bookmarks",
    "78" => "Tumblr",
    "79" => "LiveJournal",
    "80" => "Current",
    "81" => "HelloTxt",
    "82" => "Spurl",
    "83" => "Yample",
    "84" => "Oneview",
    "85" => "Linkatopia",
    "86" => "Simpy",
    "87" => "Yahoo Messenger",
    "88" => "LinkedIn",
    "89" => "Global Grind",
    "90" => "BuddyMarks",
    "91" => "Ask.com MyStuff",
    "92" => "Viadeo",
    "93" => "Maple",
    "94" => "Wists",
    "95" => "Gravee",
    "96" => "Connotea",
    "97" => "Backflip",
    "98" => "MyLinkVault",
    "99" => "SiteJot",
    "100" => "Sphinn",
    "101" => "Health Ranker",
    "102" => "DZone",
    "103" => "Symbaloo Feeds",
    "104" => "Care2 News",
    "105" => "Hyves",
    "106" => "Design Float",
    "107" => "Sphere",
    "108" => "Bitty Browser",
    "109" => "My Yahoo",
    "110" => "Google",
    "111" => "Excite MIX",
    "112" => "iTunes",
    "113" => "Zune",
    "114" => "FeedM8",
    "115" => "PodNova",
    "116" => "WINKsite",
    "117" => "NewsGator",
    "118" => "Hubdog",
    "119" => "BUZmob",
    "120" => "NewsIsFree",
    "121" => "KlipFolio",
    "122" => "NETime Channel",
    "123" => "Feed Mailer",
    "124" => "Symbaloo Bookmarks",
    "125" => "Rocket RSS Reader",
    "126" => "Blogger",
    "127" => "Flurry",
    "128" => "FireAnt",
    "129" => "Sofomo",
    "130" => "Netomat HUB",
    "131" => "FeedMarker",
    "132" => "FeedBucket",
    "133" => "SendMeRSS",
    "134" => "Bloglines",
    "135" => "Windows Live",
    "136" => "Protopage News Feeds",
    "137" => "My AOL",
    "138" => "The Free Library",
    "139" => "The Free Dictionary",
    "140" => "Wikio",
    "141" => "BlogRovR",
    "142" => "Webwag",
    "143" => "Daily Rotation",
    "144" => "Outlook",
    "145" => "Google Toolbar",
    "146" => "Bitty Browser Preview",
    "147" => "RSS 2 PDF",
    "148" => "LiteFeeds",
    "149" => "Gritwire",
    "150" => "FeedLounge",
    "151" => "FeedReader",
    "152" => "FeedOnSite",
    "153" => "i metaRSS",
    "154" => "RssFwd",
    "155" => "SimplyHeadlines",
    "156" => "Zhua Xia",
    "157" => "Xian Guo",
    "158" => "mobilerss",
    "159" => "Netvibes",
    "160" => "Pageflakes",
    "161" => "My MSN",
    "162" => "Odeo",
    "163" => "AideRSS",
    "164" => "Fwicki",
    "165" => "RapidFeeds",
    "166" => "Miro",
    "167" => "Shyftr",
    "168" => "ZapTXT",
    "169" => "Newgie",
    "170" => "NewsAlloy",
    "171" => "Plusmo",
    "172" => "Yourminis",
    "173" => "Eskobo",
    "174" => "Alesti",
    "175" => "Rasasa",
    "176" => "AvantGo",
    "177" => "FeedShow",
    "178" => "Xanga",
    "179" => "MySpace Profile",
    "180" => "Friendster",
    "181" => "Hi5",
    "182" => "FeedBlitz",
    "183" => "Gabbr",
    "184" => "MSDN",
    "185" => "Microsoft TechNet",
    "186" => "Microsoft Expression",
    "187" => "Tagza",
    "188" => "Tipd",
    "189" => "Agregator",
    "190" => "Strands",
    "191" => "Evernote",
    "192" => "Stumpedia",
    "193" => "Foxiewire",
    "194" => "Arto",
    "195" => "Netvibes",
    "196" => "Bebo",
    "197" => "Folkd",
    "198" => "VodPod",
    "199" => "NewsTrust",
    "200" => "Amazon (US) Wish List",
    "201" => "E-mail program",
    "202" => "YC Hacker News",
    "203" => "Truemors",
    "204" => "Techmeme Tip",
    "205" => "Identi.ca",
    "206" => "SmakNews",
    "207" => "Google Reader",
    "208" => "Bit.ly",
    "209" => "Kaboodle",
    "210" => "Posterous",
    "211" => "TipJoy",
    "212" => "I Heart It",
    "213" => "Google Notebook",
    "214" => "Tr.im",
    "215" => "Streakr",
    "216" => "Twine",
    "217" => "Soup",
    "218" => "Plurk",
    "219" => "Blogger",
    "220" => "TypePad",
    "221" => "AttentionMeter",
    "222" => "Smush.it",
    "223" => "TinyURL",
    "224" => "Digg",
    "225" => "BzzScapes",
    "226" => "Tweetie",
    "227" => "Diigo",
    "228" => "Is.gd",
    "229" => "vi.sualize.us",
    "230" => "WordPress Blog",
    "231" => "Mozillaca",
    "232" => "Su.pr",
    "233" => "TBUZZ",
    "234" => "Hub.tm",
    "235" => "Followup.cc",
    "236" => "PrintFriendly",
    "237" => "DailyMe",
    "238" => "NUjij",
    "239" => "Read It Later",
    "240" => "Box.net",
    "241" => "Balatarin",
    "242" => "Favoriten",
    "243" => "Oknotizie",
    "244" => "diHITT",
    "245" => "Svejo",
    "246" => "Hatena",
    "247" => "Orkut",
    "248" => "Clicky",
    "249" => "j.mp",
    "250" => "ReadWriteWeb",
    "251" => "Dwellicious",
    "252" => "Google Translate",
    "253" => "Yammer",
    "254" => "Yahoo Buzz India",
    "255" => "Boxee",
    "256" => "Pinboard",
    "257" => "Google Buzz",
    "258" => "Readability",
    "259" => "Social.com",
    "260" => "Google Apps Email",
    "261" => "HootSuite",
    "262" => "Google Wave",
    "263" => "iZeby",
    "264" => "Ning",
    "265" => "SpringPad",
    "266" => "BobrDobr",
    "267" => "Yandex",
    "268" => "Moemesto",
    "269" => "Memori.ru",
    "270" => "Amazon (UK) Wish List",
    "271" => "Amazon (CA) Wish List",
    "272" => "Amazon (DE) Wish List",
    "273" => "Amazon (FR) Wish List",
    "274" => "Amazon (JP) Wish List",
    "275" => "Google Sidewiki",
    "276" => "Marginize",
    "277" => "Twittley",
    "278" => "Script & Style",
    "279" => "PFBuzz",
    "280" => "Fwisp",
    "281" => "100 bookmarks",
    "282" => "Design Bump",
    "283" => "eKudos",
    "284" => "Web Blend",
    "285" => "Wykop",
    "286" => "BlogEngage",
    "287" => "FAQpal",
    "288" => "Bitacoras",
    "289" => "N4G",
    "290" => "Kaevur",
    "291" => "Virb",
    "292" => "BonzoBox",
    "293" => "Zabox",
    "294" => "ToMuse",
    "295" => "BuzzFeed",
    "296" => "Amazon Universal Registry",
    "297" => "TwitThat",
    "298" => "Mister-Wong DE",
    "299" => "Mister-Wong CN",
    "300" => "Mister-Wong ES",
    "301" => "Mister-Wong FR",
    "302" => "Mister-Wong RU",
    "303" => "Facebook Like",
    "304" => "Google+",
    "305" => "Facebook Send",
    "306" => "Shareaholic More",
    "307" => "Shareaholic All",
    "308" => "Buffer",
    "309" => "Pinterest",
    "310" => "Quora",
    "313" => "Shareaholic Mail",
  );
  $output = '';
  $form_element = $variables['form_element'];

  // List of SexyBookmarks services.
  $services = array(
    2,
    3,
    5,
    6,
    7,
    10,
    24,
    38,
    39,
    40,
    52,
    54,
    74,
    88,
    201,
    219,
    27,
    33,
    41,
    43,
    45,
    46,
    53,
    78,
    195,
    196,
    205,
    210,
    236,
    247,
    264,
    44,
    48,
    61,
    80,
    100,
    105,
    140,
    191,
    202,
    218,
    238,
    240,
    266,
    269,
    280,
    289,
    1,
    14,
    21,
    89,
    98,
    102,
    106,
    243,
    267,
    268,
    277,
    278,
    283,
    284,
    285,
    286,
    288,
    20,
    59,
    92,
    188,
    190,
    192,
    204,
    246,
    263,
    265,
    279,
    281,
    282,
    287,
    290,
    291,
    292,
    293,
    294,
  );
  $directory = md5(implode(',', $services));

  // Attach Javascript and Styles.
  $api = 'http://www.shareaholic.com/api/sprite/?v=2&apikey=' . SB_APIKEY . '&service=' . implode(',', $services);
  drupal_add_css(sexybookmarks_get_file($api, "{$directory}/sprite.css"));
  drupal_add_css('
    li.shareaholic {
      background-image: url("' . file_create_url(sexybookmarks_get_file("{$api}&apitype=png", "{$directory}/sprite.png")) . '");

    }

    div.shr-bookmarks ul.shr-socials li {
      cursor: move !important;
      font-size:9px !important;
      text-align:center;
    }
  ', 'inline');
  drupal_add_js(drupal_get_path('module', 'sexybookmarks') . '/scripts/sexybookmarks.admin.js');
  drupal_add_library('system', 'ui.sortable');

  // Active services list.
  $active = array();
  foreach (explode(',', $form_element['#default_value']) as $item) {
    $text_to_show = shrsb_truncate_text(end(explode('-', $services_list[$item])), 9);
    $active[] = array(
      'data' => '<div style="margin-top:26px;"></div>' . $text_to_show,
      'id' => "shr-{$item}",
      'class' => array(
        "shr-{$item}",
        'shareaholic',
      ),
    );
  }
  $output .= '<div class="shr-bookmarks clearfix">' . theme('item_list', array(
    'title' => t('Active services- Drag services to \'Inactive Services\' to add/remove services'),
    'items' => $active,
    'attributes' => array(
      'id' => 'sexybookmarks-active',
      'class' => array(
        'shr-socials',
      ),
    ),
  )) . '</div>';

  // Inactive services list.
  $inactive = array();
  foreach (array_diff($services, explode(',', $form_element['#default_value'])) as $item) {
    $text_to_show = shrsb_truncate_text(end(explode('-', $services_list[$item])), 9);
    $inactive[] = array(
      'data' => '<div style="margin-top:26px;"></div>' . $text_to_show,
      'id' => "shr-{$item}",
      'class' => array(
        "shr-{$item}",
        'shareaholic',
      ),
    );
  }
  $output .= '<div class="shr-bookmarks clearfix">' . theme('item_list', array(
    'title' => t('Inactive services'),
    'items' => $inactive,
    'attributes' => array(
      'id' => 'sexybookmarks-inactive',
      'class' => array(
        'shr-socials',
      ),
    ),
  )) . '</div>';

  // Hidden field.
  element_set_attributes($form_element, array(
    'id',
    'name',
    'value',
    'size',
    'maxlength',
  ));
  $output .= theme('hidden', array(
    'element' => $form_element,
  ));
  return $output;
}