]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
trac750 - linked in CSS file and added CSS for profile box
authorZach Copley <zach@controlyourself.ca>
Sun, 7 Dec 2008 23:59:25 +0000 (18:59 -0500)
committerZach Copley <zach@controlyourself.ca>
Sun, 7 Dec 2008 23:59:25 +0000 (18:59 -0500)
- added button for adding a box to the profile on settings

darcs-hash:20081207235925-7b5ce-224fd2482f66c2c9ac9da9ce72c1c0da0243bd83.gz

actions/facebookhome.php
actions/facebooksettings.php
lib/facebookaction.php
theme/identica/facebookapp.css [new file with mode: 0644]

index b58110bcc825d1fdae7987bc6c479673ab8273cb..b261e6a8c3634eff82cd2592b99a431300c4284b 100644 (file)
@@ -137,8 +137,9 @@ class FacebookhomeAction extends FacebookAction {
 
                echo '<ul>';
 
-               common_pagination($page > 1, $cnt > NOTICES_PER_PAGE,
-                                                 $page, 'all', array('nickname' => $user->nickname));
+               $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE,
+                                                 $page, 'index.php', array('nickname' => $user->nickname));
+
        }
 
 
@@ -147,13 +148,49 @@ class FacebookhomeAction extends FacebookAction {
 
                $notice = $user->getCurrentNotice();
 
-               $html = $this->render_notice($notice);
+               # Need to include CSS for styling the Profile box
 
-               $fbml = "<fb:wide>$html</fb:wide>";
-               $fbml .= "<fb:narrow>$html</fb:narrow>";
+               $style = '<style>
+               #notices {
+               clear: both;
+               margin: 0 auto;
+               padding: 0;
+               list-style-type: none;
+               width: 600px;
+               border-top: 1px solid #dec5b5;
+               }
+               #notices a:hover {
+               text-decoration: underline;
+               }
+               .notice_single {
+               clear: both;
+               display: block;
+               margin: 0;
+               padding: 5px 5px 5px 0;
+               min-height: 48px;
+               font-family: Georgia, "Times New Roman", Times, serif;
+               font-size: 13px;
+               line-height: 16px;
+               border-bottom: 1px solid #dec5b5;
+               background-color:#FCFFF5;
+               opacity:1;
+               }
+               .notice_single:hover {
+               background-color: #f7ebcc;
+               }
+               .notice_single p {
+               display: inline;
+               margin: 0;
+               padding: 0;
+               }
+               </style>';
+
+               $html = $this->render_notice($notice);
 
-               $fbml_main = "<fb:narrow>$html</fb:narrow>";
+               $fbml = "<fb:wide>$content $html</fb:wide>";
+               $fbml .= "<fb:narrow>$content $html</fb:narrow>";
 
+               $fbml_main = "<fb:narrow>$content $html</fb:narrow>";
 
                $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main);
 
index 3855a0c29a4cf98f81c244e1030ab1d7ea5113a0..4d7000d605e9e4e81b7593af0100817d0394a41e 100644 (file)
@@ -35,9 +35,15 @@ class FacebooksettingsAction extends FacebookAction {
 
                $fbuid = $facebook->require_login();
 
+               $fbml = '<fb:if-section-not-added section="profile">'
+                       .'<h2>Add an Identi.ca box to your profile!</h2>'
+                       .'<fb:add-section-button section="profile"/>'
+                       .'</fb:if-section-not-added>';
+
+
                $this->show_header('Settings');
 
-               echo '<h2>Coming soon...</h2>';
+               echo $fbml;
 
                $this->show_footer();
 
index 5505a12c385f7efabe72f6866f79d93d32d6be1d..8872934aaec1ba10d3d038170fa05c8908dc5e27 100644 (file)
@@ -38,7 +38,7 @@ class FacebookAction extends Action {
 
        function show_header($selected ='Home') {
 
-        # $header = '<link rel="stylesheet" type="text/css" href="" />';
+        $header = '<link rel="stylesheet" type="text/css" href="'. theme_path('facebookapp.css') . '" />';
         # $header .='<script src="" ></script>';
          $header .= '<fb:dashboard/>';
 
@@ -180,6 +180,50 @@ class FacebookAction extends Action {
 
                return $html;
        }
+       
+       function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) {
 
+               $html = '';
 
+               if ($have_before || $have_after) {
+                       $html = '<div id="pagination">';
+                       $html .'<ul id="nav_pagination">';                      
+               }
+
+               if ($have_before) {
+                       $pargs = array('page' => $page-1);
+                       $newargs = ($args) ? array_merge($args,$pargs) : $pargs;
+                       $html .= '<li class="before">';
+                       $html .'<a href="' . $this->pagination_url($fbaction, $newargs) . '">' . _('« After') . '</a>';
+                       $html .'</li>';
+               }
+
+               if ($have_after) {
+                       $pargs = array('page' => $page+1);
+                       $newargs = ($args) ? array_merge($args,$pargs) : $pargs;
+                       $html .= '<li class="after">';
+                       $html .'<a href="' . $this->pagination_url($fbaction, $newargs) . '">' . _('Before »') . '</a>';
+                       $html .'</li>';
+               }
+
+               if ($have_before || $have_after) {
+                       $html .= '<ul>';
+                       $html .'<div>';
+               }
+       }
+
+       function pagination_url($fbaction, $args=NULL) {
+               global $config;
+
+               $extra = '';
+
+               if ($args) {
+                       foreach ($args as $key => $value) {
+                               $extra .= "&${key}=${value}";
+                       }
+               }
+
+               return "$fbaction?${extra}";
+       }
+       
 }
diff --git a/theme/identica/facebookapp.css b/theme/identica/facebookapp.css
new file mode 100644 (file)
index 0000000..b2bbbac
--- /dev/null
@@ -0,0 +1,161 @@
+
+/* XXX: Most of this just copied out of display.css -- need to factor out what we really neeed -- Zach */
+
+body {
+    color: #193441;
+}
+
+a {
+color: #d1451a;
+text-decoration: none;
+}
+a:hover {
+text-decoration: underline;
+}
+img, img a {
+border: 0;
+}
+h1 {
+font-size: 14px;
+}
+
+#wrap {
+margin: 0 auto;
+padding: 0 20px;
+width: 760px;
+background: url(bg-header.gif) repeat-x #fbf2d7;
+}
+
+
+#notices {
+clear: both;
+margin: 0 auto;
+padding: 0;
+list-style-type: none;
+width: 600px;
+border-top: 1px solid #dec5b5;
+}
+#notices a:hover {
+text-decoration: underline;
+}
+.notice_single {
+clear: both;
+display: block;
+margin: 0;
+padding: 5px 5px 5px 0;
+min-height: 48px;
+font-family: Georgia, "Times New Roman", Times, serif;
+font-size: 13px;
+line-height: 16px;
+border-bottom: 1px solid #dec5b5;
+background-color:#FCFFF5;
+opacity:1;
+}
+.notice_single:hover {
+background-color: #f7ebcc;
+}
+.notice_single p {
+display: inline;
+margin: 0;
+padding: 0;
+}
+#notice_delete_form #confirmation_text {
+   display: block;
+font-size: 14px;
+font-weight: bold;
+}
+
+input#submit_yes, input#submit_no {
+margin: 18px 10px 0px 0px;
+padding: 4px;
+font-weight: bold;
+color: #fff6d5;
+background-color: #F60;
+cursor: pointer;
+border: 0;
+width: 40px;
+}
+input#submit_yes:hover, input#submit_no:hover {
+background-color: #701238;
+}
+.avatar.stream {
+float: left;
+margin: 0 10px 0.5em 0;
+}
+p.time {
+display: block;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-size: 10px;
+line-height: 15px;
+}
+p.time a {
+color: #dab134;
+}
+
+
+/* ----- Forms General Style ----- */
+form {
+       margin: 0 auto;
+       padding: 0;
+       }
+form {
+       font-family: Verdana, Arial, Helvetica, sans-serif;
+       font-size: 12px;
+       }
+form label {
+       display: block;
+       font-size: 12px;
+       font-weight: bold;
+       line-height: 18px;
+       }
+form input {
+       border: 1px solid #dec5b5;
+       width: 264px;
+       }
+input#submit, input.submit  {
+       display: block;
+       margin: 18px 0;
+       padding: 4px;
+       font-weight: bold;
+       color: #fff6d5;
+       background-color: #F60;
+       cursor: pointer;
+       border: 0;
+       width: auto;
+       }
+input#submit:hover, input.submit:hover {
+       background-color: #701238;
+       }
+input.checkbox {
+       /*width: 14px;
+       height: 14px;*/
+       width: auto;
+       border: 0;
+       }
+
+label.checkbox_label {
+    display: inline;
+    font-weight: normal;
+}
+
+textarea, input {
+       font-family: Verdana, Arial, Helvetica, sans-serif;
+       font-size: 12px;
+       color: #701238;
+       padding: 3px;
+       }
+textarea:focus, input:focus {
+       background-color: #f8ebc0;
+       }
+textarea {
+       width: 270px;
+       border: 1px solid #D8E2D7;
+       }
+.input_instructions {
+       margin-top: 3px;
+       display: block;
+       font-size: 11px;
+       line-height: 15px;
+       color: #924959;
+       font-family: Verdana, Arial, Helvetica, sans-serif;
+       }