<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>helloitsliam&#039;s blog</title>
	<atom:link href="http://vspug.com/helloitsliam/feed/" rel="self" type="application/rss+xml" />
	<link>http://vspug.com/helloitsliam</link>
	<description>Just another VSPUG - Virtual SharePoint User Group weblog</description>
	<lastBuildDate>Wed, 27 Jun 2007 19:35:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Blog URL Changing!!</title>
		<link>http://vspug.com/helloitsliam/2007/06/27/blog-url-changing/</link>
		<comments>http://vspug.com/helloitsliam/2007/06/27/blog-url-changing/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 19:35:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[
Well what can I say. After hosting my blog here for the past year I thought it was time to move it to a SharePoint based blog (as this is the technology I focus on). I want to thank Dustin and the team for all the efforts they have put in to restore the system [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Well what can I say. After hosting my blog here for the past year I thought it was time to move it to a SharePoint based blog (as this is the technology I focus on). I want to thank Dustin and the team for all the efforts they have put in to restore the system back to how it was. For me personally the amount of effort involved in putting a year&#39;s worth of blog posts back onto the community server&nbsp;will take too much time. Now I have a SharePoint based blog it is easier to post all my images and posts here. Keep an eye over the next few weeks or so and all the old posts should be back!!! I will be keeping this blog to host any of the posts I can get back, but my new stuff will now be at the new blog address below.</p>
<p>I am also&nbsp;testing&nbsp;the&nbsp;CKS:EBE (<span style="COLOR:red;">Community Kit for SharePoint: Enhanced Blog Version</span>) here as well.&nbsp;So check back soon to see my newly skinned blog!! A big thanks to&nbsp;<span style="COLOR:red;"><strong>Vince</strong></span> and the&nbsp;<span style="COLOR:red;"><strong>CKS:EBE&nbsp;Team </strong></span>for this. <img src='http://vspug.com/helloitsliam/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>The new blog link is: <a href="http://www.helloitsliam.com/">http://www.helloitsliam.com</a></p>
<p>If you wish to subscribe to the blog please remember to use:&nbsp;<a href="http://feeds.feedburner.com/helloitsliam"><span style="COLOR:#0000cc;">http://feeds.feedburner.com/helloitsliam</span></a> that way if I move it again it will still work. <img src='http://vspug.com/helloitsliam/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/06/27/blog-url-changing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog URL Changing!!</title>
		<link>http://vspug.com/helloitsliam/2007/06/27/blog-url-changing/</link>
		<comments>http://vspug.com/helloitsliam/2007/06/27/blog-url-changing/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 19:35:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[
Well what can I say. After hosting my blog here for the past year I thought it was time to move it to a SharePoint based blog (as this is the technology I focus on). I want to thank Dustin and the team for all the efforts they have put in to restore the system [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Well what can I say. After hosting my blog here for the past year I thought it was time to move it to a SharePoint based blog (as this is the technology I focus on). I want to thank Dustin and the team for all the efforts they have put in to restore the system back to how it was. For me personally the amount of effort involved in putting a year&#39;s worth of blog posts back onto the community server&nbsp;will take too much time. Now I have a SharePoint based blog it is easier to post all my images and posts here. Keep an eye over the next few weeks or so and all the old posts should be back!!! I will be keeping this blog to host any of the posts I can get back, but my new stuff will now be at the new blog address below.</p>
<p>I am also&nbsp;testing&nbsp;the&nbsp;CKS:EBE (<span style="COLOR:red;">Community Kit for SharePoint: Enhanced Blog Version</span>) here as well.&nbsp;So check back soon to see my newly skinned blog!! A big thanks to&nbsp;<span style="COLOR:red;"><strong>Vince</strong></span> and the&nbsp;<span style="COLOR:red;"><strong>CKS:EBE&nbsp;Team </strong></span>for this. <img src='http://vspug.com/helloitsliam/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>The new blog link is: <a href="http://www.helloitsliam.com/">http://www.helloitsliam.com</a></p>
<p>If you wish to subscribe to the blog please remember to use:&nbsp;<a href="http://feeds.feedburner.com/helloitsliam"><span style="COLOR:#0000cc;">http://feeds.feedburner.com/helloitsliam</span></a> that way if I move it again it will still work. <img src='http://vspug.com/helloitsliam/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/06/27/blog-url-changing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; JavaScript Item Menus Part 3 (Real World)</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-3-real-world/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-3-real-world/#comments</comments>
		<pubDate>Thu, 31 May 2007 02:18:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the things I have been asked recently has been to do with changing the &#8220;Email Link To&#8221; menu item. Sometimes this link works, sometimes it doesn&#39;t. Before we can look at changing it let&#39;s take a look at the code that is used to create this link. The code block can be found [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN:0cm 0cm 10pt;"><font>One of the things I have been asked recently has been to do with changing the &#8220;Email Link To&#8221; menu item. Sometimes this link works, sometimes it doesn&#39;t. Before we can look at changing it let&#39;s take a look at the code that is used to create this link. The code block can be found within the &#8220;AddSendSubMenu&#8221; function within the &#8220;CORE.JS&#8221; file. Here is the code block in full:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28096/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28096/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now let&#39;s step through it line by line. The first line:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28097/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28097/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This line is used to check that the current user has the correct permissions, i.e. Permission to the document or item. Next we simply populate the local variable &#8220;strDisplayText&#8221; with the globally declared variable from the top of the &#8220;CORE.JS&#8221;.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28098/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28098/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we get to the interesting bits. Each list and library when viewed within the standard pages such as &#8220;AllItems.aspx&#8221; can be accessed via JavaScript by using some built in functions. One of these is &#8220;GetAttributeFromItemTable&#8221;. This function is actually called from the &#8220;INIT.JS&#8221; file; along with a few more that you will see further down the code. This code line is connecting to the table and grabbing the &#8220;URL&#8221;, which in reality is the direct link to the document or item.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28099/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28099/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once we have the actual link then we find the root URL (the server URL) using a built in property of the list item which is referred to as CTX.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28100/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28100/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once we have the root URL it is then chopped up slightly, so we have the length, and location of the relevant slashes. The local variable &#8220;fileUrl&#8221; is also declared at this point, this is used later on. <span style="">&nbsp;</span>Now we populate the local variable by concatenating the root URL and the variable called &#8220;currentItemUrl&#8221; which is actually populated previously from the item table.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28101/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28101/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we have the new variable &#8220;fileUrl&#8221; populated and ready to use, the next variable to get populated is the &#8220;serverFileRedir&#8221;. This is used to hold any redirection page that is needed as part of the menu item link.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28102/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28102/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now that we have all the variables populated the next few lines of code simply build the menu item. The &#8220;strAction&#8221; variable contains the action that will happen when the relevant menu item is pressed. In this case it calls another function that exists within the &#8220;INIT.JS&#8221; file. This function simply encodes the relevant URL and does a &#8220;window.location&#8221; redirect. Notice also in the code we pass auto populate the body of the email with the newly populated variable &#8220;fileUrl&#8221;.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28103/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28103/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Next an image is assigned to the menu item. The images used for this are stored here:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:10pt;COLOR:red;LINE-HEIGHT:115%;"><font>C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATEIMAGES</font></span></i></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28104/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28104/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we put it all together using a built in function called &#8220;CAMOpt&#8221; which exists within the &#8220;CORE.JS&#8221;. The syntax for this is shown below but let me explain it here:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:10pt;COLOR:red;LINE-HEIGHT:115%;"><font>CAMOpt({menu or parent menu item}, {display name variable}, {code action variable}, {image variable})</font></span></i></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28105/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28105/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice that in this example the first parameter is set as &#8220;sm&#8221;. This is the ID of the &#8220;Send To&#8221; menu item on the main item menu. Some of the functions refer to the variable called &#8220;m&#8221;. This is the main menu itself and gets populated from the function called &#8220;CreateMenuEx&#8221;. In one of the last posts we looked at creating nested menun items. To achieve this we made use of this method. Last but not least it assigns a global ID to the menun item. Thisn is great as you can then create custom CSS styles that map direct to the menu item.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>So now we have stepped through the code let&#39;s modify it slightly. One of the errors you sometimes get is caused by the fact that the JavaScript URL Encodes the path before it adds it to the body of the email. An example of this is when the main server URL gets encoded also and makes the link unusable from an email client but works in the browser. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><a href="http://intranet.labs.local/StaffDirectory/Team%20Documents/DemoDoc1.docx"><font color="#0066cc">http://intranet%2Elabs%2Elocal/StaffDirectory/Team%20Documents/DemoDoc1.docx</font></a></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>By modifying the code we could make sure that the first part of the URL does not get encoded. The URL would then look as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><a href="http://intranet.labs.local/StaffDirectory/Team%20Documents/DemoDoc1.docx"><font color="#0066cc">http://intranet.labs.local/StaffDirectory/Team%20Documents/DemoDoc1.docx</font></a></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>To make this work we need to add the following line(s) into the code:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28106/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28106/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice that in this line we are calling a built in function called &#8220;UnescapeProperly&#8221; around the &#8220;httpRootWithSlash&#8221; variable and then we are using the &#8220;EscapeProperly&#8221; around the &#8220;currentItemUrl&#8221;, both of these functions are called from the &#8220;INIT.JS&#8221;. Both of these functions simply replace any spaces or special characters with their HTML (ASCII) equivalent. Next we need to tweak the link that is rendered into the body of the email. The first variable &#8220;NewEmailLength&#8221; simply grabs the item table value called &#8220;DREF&#8221;. This is used to get the relative location of the item or document. The second variable takes the current item URL and substrings the length from the previous variable which leaves us with the actual name of the file plus the extension. The idea behind this was so the subject would read: &#8220;Emailing Document Link: {Document Name}&#8221;. The &#8220;NewEmailBody&#8221; variable is populated by the variable we created earlier called &#8220;fileUrlNonEscaped&#8221;. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28107/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28107/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>You will also notice that the action variable is calling a function called &#8220;CreateMailMessage&#8221;. This is a simple function that just does a &#8220;window.location&#8221; redirect for the email. The function is:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28108/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28108/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once it all together when you access the link the email now renders as:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28109/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28109/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>As you can see by using lots of the inbuilt functions you are able to change the way that the default menu items or new menu items work within MOSS2007. As a side not I have just noticed that fellow MVP Ishai Sagi has posted his findings on what all the variables are used for from within the &#8220;itemTable&#8221;. Check his post here:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><a href="http://www.sharepoint-tips.com/2007/05/meanings-of-variables-in-context-menus.html"><font color="#800080">http://www.sharepoint-tips.com/2007/05/meanings-of-variables-in-context-menus.html</font></a></p>
<p><span style="FONT-SIZE:11pt;FONT-FAMILY:&#39;Calibri&#39;,&#39;sans-serif&#39;;mso-fareast-language:EN-US;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-GB;mso-bidi-language:AR-SA;">Hope this helps.</span> <img src="/emoticons/emotion-5.gif" alt="Wink" /><img src="/aggbug.aspx?PostID=28111" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-3-real-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; JavaScript Item Menus Part 3 (Real World)</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-3-real-world/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-3-real-world/#comments</comments>
		<pubDate>Thu, 31 May 2007 02:18:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the things I have been asked recently has been to do with changing the &#8220;Email Link To&#8221; menu item. Sometimes this link works, sometimes it doesn&#39;t. Before we can look at changing it let&#39;s take a look at the code that is used to create this link. The code block can be found [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN:0cm 0cm 10pt;"><font>One of the things I have been asked recently has been to do with changing the &#8220;Email Link To&#8221; menu item. Sometimes this link works, sometimes it doesn&#39;t. Before we can look at changing it let&#39;s take a look at the code that is used to create this link. The code block can be found within the &#8220;AddSendSubMenu&#8221; function within the &#8220;CORE.JS&#8221; file. Here is the code block in full:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28096/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28096/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now let&#39;s step through it line by line. The first line:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28097/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28097/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This line is used to check that the current user has the correct permissions, i.e. Permission to the document or item. Next we simply populate the local variable &#8220;strDisplayText&#8221; with the globally declared variable from the top of the &#8220;CORE.JS&#8221;.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28098/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28098/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we get to the interesting bits. Each list and library when viewed within the standard pages such as &#8220;AllItems.aspx&#8221; can be accessed via JavaScript by using some built in functions. One of these is &#8220;GetAttributeFromItemTable&#8221;. This function is actually called from the &#8220;INIT.JS&#8221; file; along with a few more that you will see further down the code. This code line is connecting to the table and grabbing the &#8220;URL&#8221;, which in reality is the direct link to the document or item.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28099/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28099/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once we have the actual link then we find the root URL (the server URL) using a built in property of the list item which is referred to as CTX.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28100/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28100/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once we have the root URL it is then chopped up slightly, so we have the length, and location of the relevant slashes. The local variable &#8220;fileUrl&#8221; is also declared at this point, this is used later on. <span style="">&nbsp;</span>Now we populate the local variable by concatenating the root URL and the variable called &#8220;currentItemUrl&#8221; which is actually populated previously from the item table.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28101/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28101/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we have the new variable &#8220;fileUrl&#8221; populated and ready to use, the next variable to get populated is the &#8220;serverFileRedir&#8221;. This is used to hold any redirection page that is needed as part of the menu item link.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28102/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28102/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now that we have all the variables populated the next few lines of code simply build the menu item. The &#8220;strAction&#8221; variable contains the action that will happen when the relevant menu item is pressed. In this case it calls another function that exists within the &#8220;INIT.JS&#8221; file. This function simply encodes the relevant URL and does a &#8220;window.location&#8221; redirect. Notice also in the code we pass auto populate the body of the email with the newly populated variable &#8220;fileUrl&#8221;.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28103/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28103/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Next an image is assigned to the menu item. The images used for this are stored here:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:10pt;COLOR:red;LINE-HEIGHT:115%;"><font>C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATEIMAGES</font></span></i></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28104/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28104/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we put it all together using a built in function called &#8220;CAMOpt&#8221; which exists within the &#8220;CORE.JS&#8221;. The syntax for this is shown below but let me explain it here:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:10pt;COLOR:red;LINE-HEIGHT:115%;"><font>CAMOpt({menu or parent menu item}, {display name variable}, {code action variable}, {image variable})</font></span></i></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28105/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28105/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice that in this example the first parameter is set as &#8220;sm&#8221;. This is the ID of the &#8220;Send To&#8221; menu item on the main item menu. Some of the functions refer to the variable called &#8220;m&#8221;. This is the main menu itself and gets populated from the function called &#8220;CreateMenuEx&#8221;. In one of the last posts we looked at creating nested menun items. To achieve this we made use of this method. Last but not least it assigns a global ID to the menun item. Thisn is great as you can then create custom CSS styles that map direct to the menu item.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>So now we have stepped through the code let&#39;s modify it slightly. One of the errors you sometimes get is caused by the fact that the JavaScript URL Encodes the path before it adds it to the body of the email. An example of this is when the main server URL gets encoded also and makes the link unusable from an email client but works in the browser. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><a href="http://intranet.labs.local/StaffDirectory/Team%20Documents/DemoDoc1.docx"><font color="#0066cc">http://intranet%2Elabs%2Elocal/StaffDirectory/Team%20Documents/DemoDoc1.docx</font></a></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>By modifying the code we could make sure that the first part of the URL does not get encoded. The URL would then look as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><a href="http://intranet.labs.local/StaffDirectory/Team%20Documents/DemoDoc1.docx"><font color="#0066cc">http://intranet.labs.local/StaffDirectory/Team%20Documents/DemoDoc1.docx</font></a></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>To make this work we need to add the following line(s) into the code:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28106/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28106/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice that in this line we are calling a built in function called &#8220;UnescapeProperly&#8221; around the &#8220;httpRootWithSlash&#8221; variable and then we are using the &#8220;EscapeProperly&#8221; around the &#8220;currentItemUrl&#8221;, both of these functions are called from the &#8220;INIT.JS&#8221;. Both of these functions simply replace any spaces or special characters with their HTML (ASCII) equivalent. Next we need to tweak the link that is rendered into the body of the email. The first variable &#8220;NewEmailLength&#8221; simply grabs the item table value called &#8220;DREF&#8221;. This is used to get the relative location of the item or document. The second variable takes the current item URL and substrings the length from the previous variable which leaves us with the actual name of the file plus the extension. The idea behind this was so the subject would read: &#8220;Emailing Document Link: {Document Name}&#8221;. The &#8220;NewEmailBody&#8221; variable is populated by the variable we created earlier called &#8220;fileUrlNonEscaped&#8221;. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28107/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28107/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>You will also notice that the action variable is calling a function called &#8220;CreateMailMessage&#8221;. This is a simple function that just does a &#8220;window.location&#8221; redirect for the email. The function is:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28108/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28108/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once it all together when you access the link the email now renders as:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28109/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28109/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>As you can see by using lots of the inbuilt functions you are able to change the way that the default menu items or new menu items work within MOSS2007. As a side not I have just noticed that fellow MVP Ishai Sagi has posted his findings on what all the variables are used for from within the &#8220;itemTable&#8221;. Check his post here:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><a href="http://www.sharepoint-tips.com/2007/05/meanings-of-variables-in-context-menus.html"><font color="#800080">http://www.sharepoint-tips.com/2007/05/meanings-of-variables-in-context-menus.html</font></a></p>
<p><span style="FONT-SIZE:11pt;FONT-FAMILY:&#39;Calibri&#39;,&#39;sans-serif&#39;;mso-fareast-language:EN-US;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-GB;mso-bidi-language:AR-SA;">Hope this helps.</span> <img src="/emoticons/emotion-5.gif" alt="Wink" /><img src="/aggbug.aspx?PostID=28111" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-3-real-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; DoD 5015.2 Certified</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-dod-5015-2-certified/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-dod-5015-2-certified/#comments</comments>
		<pubDate>Wed, 30 May 2007 18:16:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[MOSS2007 has passed it&#39;s certification for compliance with level DoD 5015.2. This means that soon&#160;you will be able to install an add-in that will bring the world of &#34;records management compliance&#34; closer to the&#160;MOSS2007 world. You can read an article about this using the link below:
http://www.cmswire.com/cms/records-management/microsoft-delivers-on-dod-50152-cert-promise-001323.php
Big shout to the Microsoft Guys for this!!! 

]]></description>
			<content:encoded><![CDATA[<p>MOSS2007 has passed it&#39;s certification for compliance with level DoD 5015.2. This means that soon&nbsp;you will be able to install an add-in that will bring the world of &quot;records management compliance&quot; closer to the&nbsp;MOSS2007 world. You can read an article about this using the link below:</p>
<p><a href="http://www.cmswire.com/cms/records-management/microsoft-delivers-on-dod-50152-cert-promise-001323.php">http://www.cmswire.com/cms/records-management/microsoft-delivers-on-dod-50152-cert-promise-001323.php</a></p>
<p>Big shout to the Microsoft Guys for this!!! <img src="/emoticons/emotion-19.gif" alt="Party!!!" /></p>
<p><img src="/aggbug.aspx?PostID=28053" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-dod-5015-2-certified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; DoD 5015.2 Certified</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-dod-5015-2-certified/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-dod-5015-2-certified/#comments</comments>
		<pubDate>Wed, 30 May 2007 18:16:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[MOSS2007 has passed it&#39;s certification for compliance with level DoD 5015.2. This means that soon&#160;you will be able to install an add-in that will bring the world of &#34;records management compliance&#34; closer to the&#160;MOSS2007 world. You can read an article about this using the link below:
http://www.cmswire.com/cms/records-management/microsoft-delivers-on-dod-50152-cert-promise-001323.php
Big shout to the Microsoft Guys for this!!! 

]]></description>
			<content:encoded><![CDATA[<p>MOSS2007 has passed it&#39;s certification for compliance with level DoD 5015.2. This means that soon&nbsp;you will be able to install an add-in that will bring the world of &quot;records management compliance&quot; closer to the&nbsp;MOSS2007 world. You can read an article about this using the link below:</p>
<p><a href="http://www.cmswire.com/cms/records-management/microsoft-delivers-on-dod-50152-cert-promise-001323.php">http://www.cmswire.com/cms/records-management/microsoft-delivers-on-dod-50152-cert-promise-001323.php</a></p>
<p>Big shout to the Microsoft Guys for this!!! <img src="/emoticons/emotion-19.gif" alt="Party!!!" /></p>
<p><img src="/aggbug.aspx?PostID=28053" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-dod-5015-2-certified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; JavaScript Item Menus Part 2 (Real World Examples)</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-2-real-world-examples/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-2-real-world-examples/#comments</comments>
		<pubDate>Wed, 30 May 2007 15:34:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[In the last article we looked at hiding existing menu items and also adding new sub menu items. In this article we will look at adding our own custom menus and sub menu items within the same framework as before. We will use the same code as last time but build on it slightly. The [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN:0cm 0cm 10pt;"><font>In the last article we looked at hiding existing menu items and also adding new sub menu items. In this article we will look at adding our own custom menus and sub menu items within the same framework as before. We will use the same code as last time but build on it slightly. The objective now is to create a new menu at the same level as the &#8220;Send To&#8221; menu and then add some sub menu items. For this example the sub menu items will simply link to external website addresses. To start with let&#39;s modify the code as shown below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28028/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28028/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This code block will add the relevant menus we described above. When you now access the UI the menu items should be shown as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28029/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28029/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>We could enhance this slightly further also by adding a simple hierarchy of menu items. In the real world you probably wouldn&#39;t do this as it can be quite complex to use and administer. The code needs to be changed as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28030/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28030/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This will then render as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28031/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28031/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>With a little extra JavaScript and a little creativity you can create very complex menu structures with different events that are fired based on the link clicked. The above examples are just some of the things you can do with it. </font><img src="/emoticons/emotion-2.gif" alt="Big Smile" /></p>
<p><img src="/aggbug.aspx?PostID=28034" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-2-real-world-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; JavaScript Item Menus Part 2 (Real World Examples)</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-2-real-world-examples/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-2-real-world-examples/#comments</comments>
		<pubDate>Wed, 30 May 2007 15:34:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[In the last article we looked at hiding existing menu items and also adding new sub menu items. In this article we will look at adding our own custom menus and sub menu items within the same framework as before. We will use the same code as last time but build on it slightly. The [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN:0cm 0cm 10pt;"><font>In the last article we looked at hiding existing menu items and also adding new sub menu items. In this article we will look at adding our own custom menus and sub menu items within the same framework as before. We will use the same code as last time but build on it slightly. The objective now is to create a new menu at the same level as the &#8220;Send To&#8221; menu and then add some sub menu items. For this example the sub menu items will simply link to external website addresses. To start with let&#39;s modify the code as shown below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28028/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28028/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This code block will add the relevant menus we described above. When you now access the UI the menu items should be shown as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28029/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28029/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>We could enhance this slightly further also by adding a simple hierarchy of menu items. In the real world you probably wouldn&#39;t do this as it can be quite complex to use and administer. The code needs to be changed as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28030/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28030/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This will then render as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28031/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28031/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>With a little extra JavaScript and a little creativity you can create very complex menu structures with different events that are fired based on the link clicked. The above examples are just some of the things you can do with it. </font><img src="/emoticons/emotion-2.gif" alt="Big Smile" /></p>
<p><img src="/aggbug.aspx?PostID=28034" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-2-real-world-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; JavaScript Item Menus Part 1 (Real World Examples)</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-1-real-world-examples/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-1-real-world-examples/#comments</comments>
		<pubDate>Wed, 30 May 2007 15:22:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have had quite a few emails recently about ways of either hiding, showing, adding or modifying the item level menu items that appear within lists and document library. In this post I thought I would examine what you can do and what the best approach would be (in my opinion anyway). Firstly the bulk [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN:0cm 0cm 10pt;"><font>I have had quite a few emails recently about ways of either hiding, showing, adding or modifying the item level menu items that appear within lists and document library. In this post I thought I would examine what you can do and what the best approach would be (in my opinion anyway). Firstly the bulk of the menu items are drawn from the &#8220;CORE.JS&#8221; file that resides in the &#8220;12&#8243; hive.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATELAYOUTS1033</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This file is a few thousand lines long so can be slightly cumbersome to work with. However the easiest way to find what you are after is to look at the name of the menu item you wish to change in UI and use this to search through the &#8220;CORE.JS&#8221;. For example I want to hide the &#8220;Send To&#8221; menu on all document libraries. To do this I would simply search the &#8220;CORE.JS&#8221; for the text &#8220;Send To&#8221;. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font><a href="/photos/helloitsliam/images/28015/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28015/original.aspx" border="0" alt="  " /></a></font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice when I do it highlights the variable called &#8220;L_Send_Text&#8221;.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28016/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28016/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now call we have to do is search for that variable and hey presto we have found the function that is called when creating the menus.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28017/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28017/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>So using this example let&#39;s look at completely hiding the send to menu items. This is quite a simple request but has to be done in a certain way. There are really a couple of ways of doing this. They are:</font></p>
<p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>1.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Comment out the functions that are called within the CORE.JS</font></p>
<p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>2.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Use a content editor web part and add this to the relevant pages (all of them)</font></p>
<p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>3.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Use inline script within the Master Page</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Option 1 will work well, however where possible it is not best to modify the underline files when modifying MOSS2007. Option 2 is a favourite of mine but is very hard to maintain unless you are building custom list definitions for all your content. Also it is very hard to ensure that the web part is added to every list or library. Option 3 is the best option here, simply adding the functions as inline script code will mean that any page that calls this function will automatically call the function in the Master Page, not the CORE.JS.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>So let&#39;s take option 2 for now just so we can see how this option works. The steps to take are:</font></p>
<p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>1.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Comment out the &#8220;AddSendSubMenu&#8221; in the CORE.JS</font></p>
<p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>2.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Add Content Editor Web Part to the &#8220;AllItems.aspx&#8221; page for the relevant list or library</font></p>
<p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>3.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Add the &#8220;AddSendSubMenu&#8221; function to the Content Editor Web Part</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>To comment out the function simply use the following at the beginning and the top of the function.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28018/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28018/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28019/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28019/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we need to add the content editor web part to the relevant pages. We will open up a document library for this and select the &#8220;Edit Page&#8221; option from the site actions menu. Once the page is edit mode press the &#8220;Add a Web Part&#8221; button.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28020/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28020/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we need to select the &#8220;Content Editor Web Part&#8221; to the page.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28021/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28021/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once it is on the page press the &#8220;Open Tool Pane&#8221; link within the web part and then press the &#8220;Source Editor&#8221; button. When the dialog opens add the following code:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28022/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28022/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once this added, if you select the item menu the &#8220;Send To&#8221; menu items will not appear. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28023/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28023/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Ok, so not everyone will want to hide functionality but the principle is the same for each menu item. I have worked on a few projects where the &#8220;DELETE&#8221; menu item has either been moved or removed from the item menu and the list or library menu bar. So let&#39;s look at adding it back but only the email link menu item. To do this we will change the code that exists in the content editor web part to be the following:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28024/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28024/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>When we now run the page the menu should then render as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28025/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28025/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Let&#39;s say we wanted to have an external process run from the menu item when we click a custom link. For example we might want to send the document to another system for processing or even copy the document somewhere else. This can be done quite easy by creating a new menu item and making the link a custom &#8220;aspx&#8221; page that contains our custom code. For this example we will simply pass a few query strings to custom page. To begin with let&#39;s modify our code slightly.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28026/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28026/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now when we load the page it should render as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28027/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28027/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>I won&#39;t show the code for the other page here, as you can really do whatever you want. The URL that we constructed in the JavaScript should now look as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font><font>http://intranet.labs.local/StaffDirectory/_layouts/custompages/QueryStringExample.aspx?FileID=<b style="mso-bidi-font-weight:normal;"><span style="COLOR:red;">2</span></b>&amp;FileURL=<b style="mso-bidi-font-weight:normal;"><span style="COLOR:red;">http%3A%2F%2Fintranet%2Elabs%2Elocal/StaffDirectory/Team%20Documents/DemoDoc1.doc</span></b></font></font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice that the variables that we created have now been populated. As you can see without knowing lots of complex c# or VB.Net you can create highly customisable menus within MOSS2007.</font></p>
<p><img src="/aggbug.aspx?PostID=28033" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-1-real-world-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS2007 &#8211; JavaScript Item Menus Part 1 (Real World Examples)</title>
		<link>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-1-real-world-examples/</link>
		<comments>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-1-real-world-examples/#comments</comments>
		<pubDate>Wed, 30 May 2007 15:22:00 +0000</pubDate>
		<dc:creator>helloitsliam</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have had quite a few emails recently about ways of either hiding, showing, adding or modifying the item level menu items that appear within lists and document library. In this post I thought I would examine what you can do and what the best approach would be (in my opinion anyway). Firstly the bulk [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN:0cm 0cm 10pt;"><font>I have had quite a few emails recently about ways of either hiding, showing, adding or modifying the item level menu items that appear within lists and document library. In this post I thought I would examine what you can do and what the best approach would be (in my opinion anyway). Firstly the bulk of the menu items are drawn from the &#8220;CORE.JS&#8221; file that resides in the &#8220;12&#8243; hive.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATELAYOUTS1033</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>This file is a few thousand lines long so can be slightly cumbersome to work with. However the easiest way to find what you are after is to look at the name of the menu item you wish to change in UI and use this to search through the &#8220;CORE.JS&#8221;. For example I want to hide the &#8220;Send To&#8221; menu on all document libraries. To do this I would simply search the &#8220;CORE.JS&#8221; for the text &#8220;Send To&#8221;. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font><a href="/photos/helloitsliam/images/28015/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28015/original.aspx" border="0" alt="  " /></a></font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice when I do it highlights the variable called &#8220;L_Send_Text&#8221;.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28016/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28016/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now call we have to do is search for that variable and hey presto we have found the function that is called when creating the menus.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28017/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28017/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>So using this example let&#39;s look at completely hiding the send to menu items. This is quite a simple request but has to be done in a certain way. There are really a couple of ways of doing this. They are:</font></p>
<p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>1.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Comment out the functions that are called within the CORE.JS</font></p>
<p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>2.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Use a content editor web part and add this to the relevant pages (all of them)</font></p>
<p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>3.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Use inline script within the Master Page</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Option 1 will work well, however where possible it is not best to modify the underline files when modifying MOSS2007. Option 2 is a favourite of mine but is very hard to maintain unless you are building custom list definitions for all your content. Also it is very hard to ensure that the web part is added to every list or library. Option 3 is the best option here, simply adding the functions as inline script code will mean that any page that calls this function will automatically call the function in the Master Page, not the CORE.JS.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>So let&#39;s take option 2 for now just so we can see how this option works. The steps to take are:</font></p>
<p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>1.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Comment out the &#8220;AddSendSubMenu&#8221; in the CORE.JS</font></p>
<p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>2.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Add Content Editor Web Part to the &#8220;AllItems.aspx&#8221; page for the relevant list or library</font></p>
<p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"><span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"><span style="mso-list:Ignore;"><font>3.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><font>Add the &#8220;AddSendSubMenu&#8221; function to the Content Editor Web Part</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>To comment out the function simply use the following at the beginning and the top of the function.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28018/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28018/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28019/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28019/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we need to add the content editor web part to the relevant pages. We will open up a document library for this and select the &#8220;Edit Page&#8221; option from the site actions menu. Once the page is edit mode press the &#8220;Add a Web Part&#8221; button.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28020/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28020/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now we need to select the &#8220;Content Editor Web Part&#8221; to the page.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28021/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28021/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once it is on the page press the &#8220;Open Tool Pane&#8221; link within the web part and then press the &#8220;Source Editor&#8221; button. When the dialog opens add the following code:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28022/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28022/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Once this added, if you select the item menu the &#8220;Send To&#8221; menu items will not appear. </font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28023/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28023/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Ok, so not everyone will want to hide functionality but the principle is the same for each menu item. I have worked on a few projects where the &#8220;DELETE&#8221; menu item has either been moved or removed from the item menu and the list or library menu bar. So let&#39;s look at adding it back but only the email link menu item. To do this we will change the code that exists in the content editor web part to be the following:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28024/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28024/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>When we now run the page the menu should then render as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28025/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28025/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Let&#39;s say we wanted to have an external process run from the menu item when we click a custom link. For example we might want to send the document to another system for processing or even copy the document somewhere else. This can be done quite easy by creating a new menu item and making the link a custom &#8220;aspx&#8221; page that contains our custom code. For this example we will simply pass a few query strings to custom page. To begin with let&#39;s modify our code slightly.</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28026/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28026/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Now when we load the page it should render as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><span style="mso-fareast-language:EN-GB;"><font><a href="/photos/helloitsliam/images/28027/original.aspx" target="_blank"><img src="/photos/helloitsliam/images/28027/original.aspx" border="0" alt="  " /></a></font></span></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>I won&#39;t show the code for the other page here, as you can really do whatever you want. The URL that we constructed in the JavaScript should now look as below:</font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font><font>http://intranet.labs.local/StaffDirectory/_layouts/custompages/QueryStringExample.aspx?FileID=<b style="mso-bidi-font-weight:normal;"><span style="COLOR:red;">2</span></b>&amp;FileURL=<b style="mso-bidi-font-weight:normal;"><span style="COLOR:red;">http%3A%2F%2Fintranet%2Elabs%2Elocal/StaffDirectory/Team%20Documents/DemoDoc1.doc</span></b></font></font></p>
<p style="MARGIN:0cm 0cm 10pt;"><font>Notice that the variables that we created have now been populated. As you can see without knowing lots of complex c# or VB.Net you can create highly customisable menus within MOSS2007.</font></p>
<p><img src="/aggbug.aspx?PostID=28033" width="1" height="1" alt="  " /></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/helloitsliam/2007/05/30/moss2007-javascript-item-menus-part-1-real-world-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
